/* ===== VARIABLES & RESET ===== */
:root {
  --primary: #000000;
  --primary-dark: #333333;
  --secondary: #555555;
  --bg: #ffffff;
  --bg2: #f5f5f5;
  --bg3: #eeeeee;
  --text: #111111;
  --text-muted: #666666;
  --border: #dddddd;
  --radius: 12px;
  --shadow: 0 8px 32px rgba(0,0,0,0.1);
  --transition: 0.3s ease;
}

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

html, body { width: 100%; overflow-x: hidden; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
}
.btn-primary { background: #000; color: #fff; }
.btn-primary:hover { background: #333; transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-outline { border-color: #000; color: #000; background: transparent; }
.btn-outline:hover { background: #000; color: #fff; transform: translateY(-2px); }
.btn-sm { padding: 8px 18px; font-size: 0.85rem; border-radius: 50px; background: #000; color: #fff; border: 2px solid transparent; transition: var(--transition); }
.btn-sm:hover { background: #333; }
.btn-sm.btn-outline { background: transparent; border-color: #000; color: #000; }
.btn-sm.btn-outline:hover { background: #000; color: #fff; }

/* ===== SECTION COMMON ===== */
section {
  padding: 90px 5%;
  max-width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

/* Constrain inner content to 1200px */
#about > .section-header,
#about > .about-grid,
#skills > .section-header,
#skills > .skills-grid,
#projects > .section-header,
#contact > .section-header,
#contact > .contact-grid {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.section-header { text-align: center; margin-bottom: 60px; }
.section-header h2 { font-size: 2.4rem; font-weight: 700; }
.section-header h2 span { color: var(--primary); }
.section-sub { color: var(--text-muted); margin-top: 8px; font-size: 1rem; }

/* ===== NAVBAR ===== */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 5%;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  box-shadow: 0 2px 20px rgba(0,0,0,0.08);
  transition: var(--transition);
  width: 100%;
}
#navbar.scrolled {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  box-shadow: 0 2px 20px rgba(0,0,0,0.1);
  padding: 12px 5%;
}
.nav-logo { font-size: 1.5rem; font-weight: 800; color: #000; }
.nav-logo span { color: #000; }
#navbar.scrolled .nav-logo { color: #000; }
#navbar.scrolled .nav-logo span { color: #000; }
.nav-links { display: flex; gap: 32px; }
.nav-links a { color: var(--text-muted); font-weight: 500; transition: var(--transition); position: relative; }
#navbar.scrolled .nav-links a { color: var(--text-muted); }
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 2px;
  background: var(--primary);
  transition: var(--transition);
}
.nav-links a:hover, .nav-links a.active { color: #000; }
#navbar.scrolled .nav-links a:hover, #navbar.scrolled .nav-links a.active { color: #000; }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.nav-order-btn { padding: 8px 20px !important; font-size: 0.88rem !important; }
.hamburger { display: none; background: none; border: none; color: #000; font-size: 1.4rem; cursor: pointer; }
#navbar.scrolled .hamburger { color: #000; }

/* ===== HERO ===== */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  padding-top: 100px;
  padding-bottom: 60px;
  padding-left: 5%;
  padding-right: 5%;
  max-width: 100% !important;
  background-image: url('../images/code1.jpeg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  position: relative;
}
#hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.80);
  z-index: 0;
}
#hero > * { position: relative; z-index: 1; }
.hero-content { flex: 1; }
.hero-greeting { color: #fff; font-size: 1.1rem; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; }
.hero-content h1 { font-size: clamp(2.5rem, 5vw, 4rem); font-weight: 800; line-height: 1.1; margin: 8px 0; color: #fff; }
.hero-content h2 { font-size: clamp(1.2rem, 2.5vw, 1.8rem); color: rgba(255,255,255,0.7); font-weight: 400; min-height: 2.2rem; }
.hero-desc { color: rgba(255,255,255,0.7); margin: 20px 0 32px; max-width: 480px; font-size: 1.05rem; }
.hero-btns { display: flex; gap: 16px; flex-wrap: wrap; }
.hero-socials { display: flex; gap: 16px; margin-top: 36px; }
.hero-socials a {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.4);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.7);
  font-size: 1.1rem;
  transition: var(--transition);
}
.hero-socials a:hover { border-color: #fff; color: #fff; transform: translateY(-3px); }

.hero-image { flex: 0 0 auto; }
.avatar-ring {
  width: 300px; height: 300px;
  border-radius: 50%;
  padding: 6px;
  background: linear-gradient(135deg, #ffffff, #888888);
  box-shadow: 0 0 60px rgba(255,255,255,0.2);
  animation: float 4s ease-in-out infinite;
}
.avatar-ring img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 4px solid #000; }
.avatar-inner { position: relative; width: 100%; height: 100%; border-radius: 50%; overflow: hidden; border: 4px solid #000; }
.avatar-inner img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0.45; }
.avatar-initials {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 3.5rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0,0,0,0.7);
  letter-spacing: 2px;
  pointer-events: none;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-16px); }
}

/* ===== ABOUT ===== */
#about { background: var(--bg2); max-width: 100%; padding: 90px 5%; }
#about > * { max-width: 1200px; margin-left: auto; margin-right: auto; }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: start; max-width: 1200px; margin: 0 auto; }
.about-text p { color: var(--text-muted); margin-bottom: 16px; }
.about-text strong { color: var(--text); }
.about-stats { display: flex; gap: 32px; margin: 32px 0; }
.stat { text-align: center; }
.stat span { font-size: 2rem; font-weight: 800; color: var(--primary); display: block; }
.stat p { color: var(--text-muted); font-size: 0.85rem; }
.about-details ul { display: flex; flex-direction: column; gap: 16px; }
.about-details li { display: flex; align-items: center; gap: 12px; color: var(--text-muted); }
.about-details li i { color: var(--primary); width: 20px; }
.about-details strong { color: var(--text); }

/* ===== SKILLS ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 16px;
}
.skill-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 16px;
  text-align: center;
  transition: var(--transition);
  cursor: default;
}
.skill-card:hover { border-color: var(--primary); transform: translateY(-6px); box-shadow: var(--shadow); }
.skill-card i { font-size: 2.2rem; color: var(--primary); display: block; margin-bottom: 10px; }
.skill-card span { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }

/* ===== PROJECTS ===== */
#projects { background: var(--bg2); max-width: 100%; padding: 90px 5%; }
#projects .section-header, .filter-btns, .projects-grid { max-width: 1200px; margin-left: auto; margin-right: auto; }
.filter-btns { display: flex; gap: 12px; justify-content: center; margin-bottom: 40px; flex-wrap: wrap; }
.filter-btn {
  padding: 8px 22px;
  border-radius: 50px;
  border: 2px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 500;
  transition: var(--transition);
}
.filter-btn.active, .filter-btn:hover { border-color: #000; color: #000; background: rgba(0,0,0,0.06); }
.projects-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.project-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
}
.project-card:hover { transform: translateY(-8px); box-shadow: var(--shadow); border-color: #000; }
.project-card.hidden { display: none; }
.project-img img, .project-img svg { width: 100%; height: 200px; object-fit: cover; display: block; }
.project-info { padding: 20px; }
.project-info h3 { font-size: 1.1rem; margin-bottom: 8px; }
.project-info p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 14px; }
.project-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.project-tags span {
  background: rgba(0,0,0,0.06);
  color: #000;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 600;
}
.project-links { display: flex; gap: 10px; }

/* ===== CONTACT ===== */
.contact-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 60px; align-items: start; }
.contact-item { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 28px; }
.contact-item i { font-size: 1.3rem; color: var(--primary); margin-top: 3px; }
.contact-item h4 { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 2px; }
.contact-item p { font-weight: 500; }
.contact-socials { display: flex; gap: 14px; margin-top: 8px; }
.contact-socials a {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: var(--transition);
}
.contact-socials a:hover { border-color: #000; color: #000; transform: translateY(-3px); }

.contact-form { display: flex; flex-direction: column; gap: 16px; }
.form-group { position: relative; }
.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 14px 18px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  transition: var(--transition);
  outline: none;
  resize: vertical;
}
.contact-form input:focus,
.contact-form textarea:focus { border-color: #000; }
.contact-form input::placeholder,
.contact-form textarea::placeholder { color: var(--text-muted); }
.error-msg { color: #cc0000; font-size: 0.8rem; margin-top: 4px; display: block; min-height: 16px; }
.form-success { color: #007700; font-size: 0.9rem; display: none; margin-top: 4px; }
.form-success.show { display: block; }

/* ===== FOOTER ===== */
footer {
  background: #000;
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 28px 5%;
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
  position: relative;
}
.back-to-top {
  position: absolute;
  right: 5%;
  top: 50%;
  transform: translateY(-50%);
  width: 40px; height: 40px;
  background: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #000;
  transition: var(--transition);
}
.back-to-top:hover { background: #ccc; transform: translateY(calc(-50% - 3px)); }

/* ===== ANIMATIONS ===== */
.fade-in { opacity: 0; transform: translateY(30px); transition: opacity 0.6s ease, transform 0.6s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  #hero { flex-direction: column-reverse; text-align: center; padding-top: 120px; min-height: auto; padding-bottom: 60px; }
  .hero-btns, .hero-socials { justify-content: center; }
  .hero-desc { margin-left: auto; margin-right: auto; }
  .avatar-ring { width: 220px; height: 220px; }
  .about-grid, .contact-grid { grid-template-columns: 1fr; gap: 40px; }
  .about-stats { justify-content: center; }
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .skills-grid { grid-template-columns: repeat(5, 1fr); }
}

@media (max-width: 600px) {
  .nav-links { display: none; flex-direction: column; position: absolute; top: 70px; left: 0; right: 0; width: 100%; background: #fff; padding: 20px 5%; gap: 20px; border-bottom: 1px solid var(--border); box-shadow: 0 8px 20px rgba(0,0,0,0.1); }
  .nav-links a { color: var(--text-muted) !important; }
  .nav-links.open { display: flex; }
  .hamburger { display: block; }
  .section-header h2 { font-size: 1.6rem; }
  .projects-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: repeat(3, 1fr); }
  .hero-content h1 { font-size: 2.2rem; }
  .avatar-ring { width: 180px; height: 180px; }
  section { padding: 60px 4%; }
  #about, #projects { padding: 60px 4%; }
  .about-stats { gap: 16px; }
  .contact-grid { grid-template-columns: 1fr; }
  .filter-btns { gap: 8px; }
  .filter-btn { padding: 6px 14px; font-size: 0.82rem; }
  .project-info { padding: 14px; }
  .btn { padding: 10px 20px; font-size: 0.88rem; }
}

@media (max-width: 400px) {
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .projects-grid { grid-template-columns: 1fr; }
  .hero-content h1 { font-size: 1.8rem; }
  .section-header h2 { font-size: 1.4rem; }
}
