/* ===== CSS VARIABLES ===== */
:root {
  --bg: #f8f9fa;
  --bg-alt: #eef0f3;
  --surface: #ffffff;
  --border: #e0e3e8;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-light: #dbeafe;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --radius: 16px;
  --nav-h: 72px;
}

[data-theme="dark"] {
  --bg: #0f1117;
  --bg-alt: #161b27;
  --surface: #1e2433;
  --border: #2d3448;
  --text: #e8eaf0;
  --text-muted: #9ca3af;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-light: #1e3a5f;
  --shadow: 0 2px 12px rgba(0,0,0,0.4);
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background 0.3s, color 0.3s;
  line-height: 1.7;
  font-size: 22px;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* ===== NAVBAR ===== */
.navbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 5%;
  gap: 2rem;
  z-index: 1000;
  box-shadow: var(--shadow);
}
.logo { font-size: 2rem; font-weight: 700; color: var(--text); }
.logo span { color: var(--accent); }
.nav-links { display: flex; gap: 2rem; margin-left: auto; }
.nav-links a {
  font-size: 1.2rem; font-weight: 500; color: var(--text-muted);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--accent); }
.theme-toggle {
  background: var(--bg-alt); border: 1px solid var(--border);
  border-radius: 50%; width: 38px; height: 38px;
  cursor: pointer; color: var(--text); font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.theme-toggle:hover { background: var(--accent-light); }
.hamburger {
  display: none; background: none; border: none;
  font-size: 1.3rem; cursor: pointer; color: var(--text);
}

/* ===== SECTIONS ===== */
.section { padding: 110px 7% 90px; }
.alt-bg { background: var(--bg-alt); }
.section-title {
  font-size: 3rem; font-weight: 700; text-align: center;
  margin-bottom: 60px; color: var(--text);
  position: relative;
}
.section-title::after {
  content: ''; display: block; width: 50px; height: 3px;
  background: var(--accent); margin: 10px auto 0; border-radius: 2px;
}

/* ===== HERO ===== */
.hero {
  min-height: 100vh;
  display: flex; align-items: center;
  padding: calc(var(--nav-h) + 60px) 7% 80px;
  background: var(--bg);
    position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 20% 50%, rgba(37,99,235,0.35) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(99,102,241,0.25) 0%, transparent 55%),
              radial-gradient(ellipse at 60% 80%, rgba(59,130,246,0.20) 0%, transparent 50%);
  animation: heroBgShift 8s ease-in-out infinite alternate;
  pointer-events: none;
}
[data-theme="dark"] .hero::before {
  background: radial-gradient(ellipse at 20% 50%, rgba(37,99,235,0.18) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(99,102,241,0.13) 0%, transparent 55%),
              radial-gradient(ellipse at 60% 80%, rgba(59,130,246,0.10) 0%, transparent 50%);
}
@keyframes heroBgShift {
  0%   { opacity: 1; transform: scale(1); }
  100% { opacity: 0.7; transform: scale(1.08); }
}
.hero-content { position: relative; z-index: 1; 
}
.hero-content {
  display: flex; align-items: center; gap: 80px;
  max-width: 1300px; margin: 0 auto; width: 100%;
}
/* ===== FIXED HERO IMAGE ===== */
.hero-photo {
  width: 380px;
  height: 380px;
  border-radius: 50%;
  overflow: hidden; /* ensures proper circular crop */
  border: 5px solid var(--accent);
  box-shadow: 0 0 0 12px var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;        /* prevents stretching */
  object-position: center;  /* adjust if needed */
}

.hero-text { flex: 1; }
.greeting { color: var(--text-muted); font-size: 1.90rem; margin-bottom: 6px; }
.hero-text h1 { font-size: 4.5rem; font-weight: 800; line-height: 1.1; }
.title-tag {
  font-size: 1.9rem; color: var(--accent); font-weight: 600; margin: 10px 0;
}
.subtitle { color: var(--text-muted); font-size: 1.35rem; margin: 12px 0 22px; }
.badges { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 28px; }
.badges span {
  background: var(--accent-light); color: var(--accent);
  padding: 8px 20px; border-radius: 20px; font-size: 1.1rem; font-weight: 600;
}
.hero-btns { display: flex; gap: 14px; flex-wrap: wrap; }

.social-icons {
  display: flex; gap: 16px; flex-wrap: wrap; margin-top: 28px; align-items: center;
}
.social-icons a {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 1.3rem;
  box-shadow: var(--shadow); transition: all 0.2s;
}
.social-icons a:hover {
  background: var(--accent); color: #fff;
  border-color: var(--accent); transform: translateY(-3px);
}
.social-icons a img {
  width: 1.3rem; height: 1.3rem; object-fit: contain;
  filter: invert(44%) sepia(8%) saturate(500%) hue-rotate(182deg) brightness(95%) contrast(90%);
  transition: filter 0.2s;
}
.social-icons a:hover img {
  filter: brightness(0) invert(1);
}

/* ===== BUTTONS ===== */
.btn {
  padding: 16px 36px; border-radius: 10px; font-weight: 600;
  font-size: 1.2rem; cursor: pointer; transition: all 0.2s; border: none;
  display: inline-block;
}
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn.secondary {
  background: transparent; color: var(--accent);
  border: 2px solid var(--accent);
}
.btn.secondary:hover { background: var(--accent-light); }

/* ===== ABOUT ===== */
.about-container { max-width: 1000px; margin: 0 auto; }
.about-text p { color: var(--text-muted); margin-bottom: 20px; font-size: 1.25rem; }
.skills-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 16px; margin-top: 32px;
}
.skill-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 22px;
  font-size: 1.15rem; font-weight: 600; color: var(--text);
  display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow);
}
.skill-item i { color: var(--accent); font-size: 1.35rem; }
.skill-item img { width: 1.35rem; height: 1.35rem; object-fit: contain; filter: brightness(0) saturate(100%) invert(29%) sepia(89%) saturate(1500%) hue-rotate(210deg) brightness(97%) contrast(97%); }

/* ===== SERVICES ===== */
.services-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px; max-width: 1300px; margin: 0 auto;
}
.service-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 44px 34px;
  box-shadow: var(--shadow); transition: transform 0.2s, box-shadow 0.2s;
  text-align: center;
}
.service-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,0.12); }
.service-card > i {
  font-size: 2.8rem; color: var(--accent); margin-bottom: 20px;
}
.service-card h3 { font-size: 1.5rem; margin-bottom: 14px; }
.service-card p { color: var(--text-muted); font-size: 1.2rem; }

/* ===== PROJECTS ===== */
.projects-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 30px; max-width: 1300px; margin: 0 auto;
}
.project-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 34px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.project-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,0.12); }
.project-header {
  display: flex; align-items: center; justify-content: space-between;
}
.project-header > i { font-size: 1.9rem; color: var(--accent); }
.project-lang {
  font-size: 0.88rem; font-weight: 600; background: var(--accent-light);
  color: var(--accent); padding: 5px 14px; border-radius: 20px;
}
.project-card h3 { font-size: 1.45rem; font-weight: 700; }
.project-card p { color: var(--text-muted); font-size: 1.15rem; flex: 1; }
.project-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.project-tags span {
  font-size: 1rem; background: var(--bg-alt); color: var(--text-muted);
  padding: 6px 16px; border-radius: 20px; border: 1px solid var(--border);
}
.project-link {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--accent); font-size: 1.15rem; font-weight: 600;
  margin-top: 4px; transition: color 0.2s;
}
.project-link:hover { color: var(--accent-hover); }

/* ===== CONTACT ===== */
.contact-container {
  display: grid; grid-template-columns: 1fr 2fr;
  gap: 60px; max-width: 1100px; margin: 0 auto; align-items: start;
}
.contact-info p { color: var(--text-muted); margin-bottom: 24px; font-size: 1.25rem; }
.contact-links { display: flex; flex-direction: column; gap: 16px; }
.contact-links a {
  display: flex; align-items: center; gap: 12px;
  color: var(--accent); font-weight: 600; font-size: 1.25rem;
  transition: color 0.2s;
}
.contact-links a:hover { color: var(--accent-hover); }
.contact-form { display: flex; flex-direction: column; gap: 18px; }
.form-group input, .form-group textarea {
  width: 100%; padding: 16px 22px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); font-size: 1.2rem;
  font-family: inherit; transition: border-color 0.2s;
  outline: none;
}
.form-group input:focus, .form-group textarea:focus {
  border-color: var(--accent);
}
.form-group textarea { resize: vertical; }
.form-success {
  display: none; color: #16a34a; font-size: 0.9rem; font-weight: 600;
}
.form-success.show { display: block; }

/* ===== FOOTER ===== */
.footer {
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 30px 7%; display: flex; align-items: center;
  justify-content: space-between; color: var(--text-muted); font-size: 1.15rem;
}
.footer a { color: var(--text-muted); font-size: 1.5rem; transition: color 0.2s; }
.footer a:hover { color: var(--accent); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .nav-links { display: none; flex-direction: column; position: absolute;
    top: var(--nav-h); left: 0; right: 0; background: var(--surface);
    border-bottom: 1px solid var(--border); padding: 20px 5%; gap: 16px; }
  .nav-links.open { display: flex; }
  .hamburger { display: block; }
  .hero-content { flex-direction: column; text-align: center; gap: 30px; }
  .hero-photo img { width: 200px; height: 200px; }
  .hero-text h1 { font-size: 3rem; }
  .badges, .hero-btns { justify-content: center; }
  .contact-container { grid-template-columns: 1fr; }
}
