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

:root {
  --accent: #6366f1;
  --accent-light: #e0e7ff;
  --accent-dark: #4f46e5;
  --text: #18181b;
  --text-muted: #71717a;
  --bg: #ffffff;
  --bg-alt: #fafafa;
  --border: #e4e4e7;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 10px 32px rgba(0,0,0,.08);
  --transition: 0.22s ease;
  --nav-h: 68px;
}

html { scroll-behavior: smooth; font-size: 16px; }

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

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

/* =====================
   TYPOGRAPHY
===================== */
h1 { font-size: clamp(2.4rem, 6vw, 4rem); font-weight: 700; line-height: 1.12; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
h3 { font-size: 1.15rem; font-weight: 600; }
p { color: var(--text-muted); }
strong { color: var(--text); }

/* =====================
   LAYOUT
===================== */
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

.section { padding: 100px 0; }
.section-alt { background: var(--bg-alt); }

.section-header { margin-bottom: 56px; }
.section-tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.section-header h2 { margin-bottom: 12px; }
.section-desc { font-size: 1.05rem; max-width: 520px; }

/* =====================
   NAVBAR
===================== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 100;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.navbar.scrolled { border-color: var(--border); box-shadow: var(--shadow); }

.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text);
  transition: opacity var(--transition);
}
.nav-logo span { color: var(--accent); }
.nav-logo:hover { opacity: 0.75; }

.nav-links {
  display: flex;
  list-style: none;
  gap: 36px;
}
.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition);
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transition: width var(--transition);
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =====================
   BUTTONS
===================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: 2px solid transparent;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(99,102,241,.35); }

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.btn-outline {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}
.btn-outline:hover { background: var(--accent); color: #fff; transform: translateY(-1px); }

.btn-full { width: 100%; justify-content: center; }

/* =====================
   HERO
===================== */
.hero {
  min-height: 100vh;
  padding-top: var(--nav-h);
  display: flex;
  align-items: center;
  background: linear-gradient(160deg, #ffffff 60%, #f5f3ff 100%);
}

.hero-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 80px 24px;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 64px;
  align-items: center;
}

.hero-content { position: relative; z-index: 1; }

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-light);
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: 24px;
  letter-spacing: 0.02em;
}
.hero-tag::before {
  content: '';
  display: block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.hero-name { color: var(--text); margin-bottom: 16px; }
.hero-name span { color: var(--accent); }

.hero-subtitle { font-size: 1.05rem; margin-bottom: 24px; color: var(--text-muted); }

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 36px;
}
.hero-chip {
  font-size: 0.78rem;
  font-weight: 500;
  padding: 5px 14px;
  background: #fff;
  border: 1.5px solid var(--border);
  color: var(--text);
  border-radius: 100px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.hero-photo-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-blob-bg {
  position: absolute;
  inset: -40px;
  background: radial-gradient(circle at 50% 50%, #e0e7ff 0%, #f5f3ff 55%, transparent 75%);
  border-radius: 60% 40% 70% 30% / 40% 60% 30% 70%;
  animation: morphBlob 12s ease-in-out infinite;
  z-index: 0;
}
@keyframes morphBlob {
  0%, 100% { border-radius: 60% 40% 70% 30% / 40% 60% 30% 70%; }
  33%       { border-radius: 40% 60% 30% 70% / 60% 40% 70% 30%; }
  66%       { border-radius: 70% 30% 50% 50% / 30% 70% 50% 50%; }
}
.hero-photo {
  position: relative;
  z-index: 1;
  width: 300px; height: 300px;
  border-radius: 50%;
  overflow: hidden;
  border: 5px solid #fff;
  box-shadow: 0 20px 60px rgba(99,102,241,.18), 0 4px 16px rgba(0,0,0,.08);
}
.hero-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center top;
}

/* =====================
   ABOUT
===================== */
.about-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 64px;
  align-items: start;
}

.photo-placeholder {
  width: 200px; height: 200px;
  border-radius: 50%;
  background: var(--bg-alt);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.photo-placeholder svg { width: 120px; }
.photo-placeholder img { width: 100%; height: 100%; object-fit: cover; }

.about-text p { margin-bottom: 16px; line-height: 1.75; }

.about-stats {
  display: flex;
  gap: 36px;
  margin: 28px 0 28px;
  flex-wrap: wrap;
}
.stat { display: flex; flex-direction: column; }
.stat strong { font-size: 1.8rem; font-weight: 700; color: var(--accent); line-height: 1; }
.stat span { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }

/* =====================
   SKILLS
===================== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

.skill-category {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}
.skill-category h3 {
  margin-bottom: 20px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.skill-item { margin-bottom: 16px; }
.skill-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text);
}
.skill-info span:last-child { color: var(--text-muted); font-size: 0.8rem; }

.skill-bar {
  height: 5px;
  background: var(--border);
  border-radius: 100px;
  overflow: hidden;
}
.skill-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
  border-radius: 100px;
  transition: width 1.2s cubic-bezier(.22,1,.36,1);
}

.skill-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-size: 0.78rem;
  font-weight: 500;
  padding: 5px 12px;
  background: var(--accent-light);
  color: var(--accent-dark);
  border-radius: 100px;
}

.skill-category--ai {
  border-color: #d1fae5;
  background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
}
.skill-category--ai h3 { color: #059669; }
.ai-fill {
  background: linear-gradient(90deg, #10b981, #059669) !important;
}
.tag--ai {
  background: #d1fae5;
  color: #065f46;
}

/* =====================
   PROJECTS
===================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
}

.project-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
  transition: transform var(--transition), box-shadow var(--transition);
}
.project-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

.project-image { height: 180px; overflow: hidden; }
.project-placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, color-mix(in srgb, var(--color) 15%, white), color-mix(in srgb, var(--color) 30%, white));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color);
  letter-spacing: -0.02em;
}

.esp32-bg {
  background: linear-gradient(135deg, #1a1000 0%, #1f1500 50%, #2a1d00 100%);
  position: relative;
  overflow: hidden;
}
.esp32-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 40%, rgba(245,158,11,0.18) 0%, transparent 65%);
}

.tvbox-bg {
  background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 50%, #111827 100%);
  position: relative;
  overflow: hidden;
}
.tvbox-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 60%, rgba(249,115,22,0.15) 0%, transparent 60%);
}

.siersat-bg {
  background: linear-gradient(135deg, #050d1a 0%, #0a1628 50%, #0d1f3c 100%);
  position: relative;
  overflow: hidden;
}
.siersat-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(0,200,255,0.15) 0%, transparent 60%);
}
.project-logo-text {
  position: relative;
  font-size: 1.5rem;
  font-weight: 300;
  color: #ffffff;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.project-logo-text strong {
  font-weight: 700;
  color: #00d4ff;
}

.project-info { padding: 24px; }
.project-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.project-info h3 { margin-bottom: 8px; color: var(--text); }
.project-info p { font-size: 0.88rem; margin-bottom: 20px; }

.project-links { display: flex; gap: 10px; }
.link-btn {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  background: transparent;
  transition: all var(--transition);
}
.link-btn:hover { background: var(--accent); color: #fff; }
.link-ghost { border-color: var(--border); color: var(--text-muted); }
.link-ghost:hover { border-color: var(--text); background: var(--text); color: #fff; }

/* =====================
   CONTACT
===================== */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 64px;
  align-items: start;
}
.contact-layout--simple {
  grid-template-columns: 1fr;
  max-width: 480px;
}

.contact-form { display: flex; flex-direction: column; gap: 20px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.form-group input,
.form-group textarea {
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  resize: vertical;
}
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.form-note { font-size: 0.82rem; text-align: center; height: 20px; transition: color var(--transition); }

.contact-info { display: flex; flex-direction: column; gap: 16px; padding-top: 8px; }
.contact-link {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  transition: all var(--transition);
}
.contact-link:hover { border-color: var(--accent); transform: translateX(4px); }
.contact-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
  transition: all var(--transition);
}
.contact-icon--email    { background: #fef2f2; color: #ef4444; }
.contact-icon--linkedin { background: #eff6ff; color: #0a66c2; }
.contact-icon--github   { background: #f4f4f5; color: #24292e; }
.contact-icon--site     { background: #f0fdf4; color: #16a34a; }

.contact-link:hover .contact-icon--email    { background: #ef4444; color: #fff; }
.contact-link:hover .contact-icon--linkedin { background: #0a66c2; color: #fff; }
.contact-link:hover .contact-icon--github   { background: #24292e; color: #fff; }
.contact-link:hover .contact-icon--site     { background: #16a34a; color: #fff; }
.contact-link div strong { display: block; font-size: 0.9rem; color: var(--text); }
.contact-link div span { font-size: 0.8rem; color: var(--text-muted); }

/* =====================
   FOOTER
===================== */
.footer {
  padding: 28px 0;
  border-top: 1px solid var(--border);
  text-align: center;
}
.footer p { font-size: 0.85rem; color: var(--text-muted); }

/* =====================
   SCROLL REVEAL
===================== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible { opacity: 1; transform: none; }

/* =====================
   RESPONSIVE
===================== */
@media (max-width: 900px) {
  .skills-grid { grid-template-columns: 1fr; }
  .contact-layout { grid-template-columns: 1fr; gap: 40px; }
  .about-grid { grid-template-columns: 1fr; gap: 36px; }
  .about-photo { display: flex; justify-content: center; }
  .hero-photo-wrap { display: none; }
  .hero-inner { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .section { padding: 72px 0; }
  .skills-grid { grid-template-columns: 1fr; }
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h); left: 0; right: 0;
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 20px 24px 28px;
    gap: 0;
    border-bottom: 1px solid var(--border);
  }
  .nav-links.open { display: flex; }
  .nav-links li { border-bottom: 1px solid var(--border); }
  .nav-links a { display: block; padding: 14px 0; }
  .nav-toggle { display: flex; }
  .hero-actions { flex-direction: column; }
  .projects-grid { grid-template-columns: 1fr; }
}
