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

:root {
  --bg: #0d1117;
  --bg2: #161b22;
  --bg3: #1c2330;
  --accent: #58a6ff;
  --accent2: #3fb950;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --border: #30363d;
  --radius: 12px;
  --nav-h: 64px;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; transition: opacity .2s; }
a:hover { opacity: .8; }

/* ===== NAVBAR ===== */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(13, 17, 23, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
}

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

.logo {
  font-size: 1.2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  font-size: .9rem;
  letter-spacing: .03em;
  transition: color .2s;
}
.nav-links a:hover { color: var(--text); opacity: 1; }

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

.mobile-menu {
  display: none;
  flex-direction: column;
  list-style: none;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 12px 0;
}
.mobile-menu.open { display: flex; }
.mobile-menu li a {
  display: block;
  padding: 10px 24px;
  color: var(--text-muted);
  font-size: .95rem;
}
.mobile-menu li a:hover { color: var(--text); }

/* ===== HERO ===== */
#hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--nav-h) + 40px) 24px 80px;
  background: radial-gradient(ellipse at 50% 0%, rgba(88, 166, 255, 0.08) 0%, transparent 70%);
  position: relative;
}

.avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  margin: 0 auto 24px;
  box-shadow: 0 0 40px rgba(88, 166, 255, 0.3);
}

#hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: 12px;
}

.tagline {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--accent);
  margin-bottom: 16px;
  font-weight: 500;
}
.tagline .sep { color: var(--text-muted); margin: 0 6px; }

.hero-sub {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 480px;
  margin: 0 auto 32px;
}

.hero-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 8px;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.btn:hover { transform: translateY(-2px); opacity: 1; }
.btn-primary {
  background: var(--accent);
  color: #0d1117;
  box-shadow: 0 4px 20px rgba(88, 166, 255, 0.3);
}
.btn-primary:hover { box-shadow: 0 6px 28px rgba(88, 166, 255, 0.45); }
.btn-outline {
  border: 1px solid var(--border);
  color: var(--text);
  background: transparent;
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-full { width: 100%; text-align: center; }

/* ===== SCROLL INDICATOR ===== */
.scroll-indicator {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
}
.scroll-indicator span {
  display: block;
  width: 24px;
  height: 40px;
  border: 2px solid var(--border);
  border-radius: 12px;
  position: relative;
}
.scroll-indicator span::before {
  content: '';
  position: absolute;
  top: 6px; left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 8px;
  background: var(--accent);
  border-radius: 2px;
  animation: scrollBounce 1.8s infinite;
}
@keyframes scrollBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 1; }
  80% { transform: translateX(-50%) translateY(12px); opacity: 0; }
}

/* ===== SECTIONS ===== */
section { padding: 90px 24px; }
section:nth-child(even) { background: var(--bg2); }

.container { max-width: 1100px; margin: 0 auto; }

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
  position: relative;
}
.section-title::after {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 2px;
  margin: 12px auto 0;
}
.section-sub {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 52px;
  font-size: .95rem;
}

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

.about-text p { color: var(--text-muted); margin-bottom: 16px; line-height: 1.75; }
.about-text strong { color: var(--text); }

.about-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.badge {
  padding: 4px 14px;
  border-radius: 100px;
  background: rgba(88, 166, 255, 0.1);
  border: 1px solid rgba(88, 166, 255, 0.25);
  color: var(--accent);
  font-size: .8rem;
  font-weight: 500;
}

.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.stat-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
}
.stat-num {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
}
.stat-label {
  display: block;
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ===== SKILLS ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.skill-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: border-color .2s, transform .2s;
}
.skill-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
}

.skill-icon { font-size: 2rem; margin-bottom: 12px; }

.skill-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.skill-card p {
  color: var(--text-muted);
  font-size: .88rem;
  line-height: 1.65;
  margin-bottom: 16px;
}

.skill-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.skill-tags span {
  padding: 3px 10px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: .75rem;
  color: var(--text-muted);
}

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

.project-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: border-color .2s, transform .2s;
}
.project-card:hover {
  border-color: var(--accent2);
  transform: translateY(-4px);
}

.project-header { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.project-tag {
  padding: 3px 10px;
  background: rgba(63, 185, 80, 0.1);
  border: 1px solid rgba(63, 185, 80, 0.3);
  color: var(--accent2);
  border-radius: 6px;
  font-size: .75rem;
  font-weight: 500;
}

.project-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.project-card p {
  color: var(--text-muted);
  font-size: .88rem;
  line-height: 1.65;
  margin-bottom: 14px;
}

.project-highlights {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.project-highlights li {
  font-size: .83rem;
  color: var(--text-muted);
  padding-left: 16px;
  position: relative;
}
.project-highlights li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent2);
}

/* ===== CONTACT ===== */
.contact-wrapper {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 48px;
  align-items: start;
}

.contact-info { display: flex; flex-direction: column; gap: 24px; }

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.contact-icon { font-size: 1.4rem; line-height: 1; flex-shrink: 0; }

.contact-item strong {
  display: block;
  font-size: .8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 2px;
}
.contact-item a, .contact-item span {
  font-size: .9rem;
  color: var(--text);
}

/* ===== FORM ===== */
.contact-form {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label {
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-muted);
}
.form-group input,
.form-group textarea {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 14px;
  font-size: .9rem;
  font-family: inherit;
  transition: border-color .2s;
  outline: none;
  resize: vertical;
}
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-muted); }

.form-note {
  font-size: .85rem;
  color: var(--accent2);
  text-align: center;
  min-height: 20px;
}

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

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .hamburger { display: block; }

  .about-grid { grid-template-columns: 1fr; gap: 32px; }
  .about-stats { grid-template-columns: 1fr 1fr; }

  .contact-wrapper { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  section { padding: 60px 16px; }
  .about-stats { grid-template-columns: 1fr 1fr; }
  .hero-btns { flex-direction: column; align-items: center; }
}

/* ===== EDIT MODE BANNER ===== */
#editBanner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 2000;
  background: linear-gradient(90deg, #1a3a5c, #0d2137);
  border-bottom: 2px solid var(--accent);
  padding: 10px 24px;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: .85rem;
  color: var(--text);
  flex-wrap: wrap;
}
#editBanner.visible { display: flex; }

.edit-banner-actions { display: flex; gap: 10px; flex-shrink: 0; }

.banner-btn {
  padding: 6px 16px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
}
.banner-btn:hover { opacity: .85; }
.done-btn { background: var(--accent); color: #0d1117; }
.reset-btn { background: transparent; border-color: var(--border); color: var(--text-muted); }

/* Shift page down when banner is visible */
body.edit-mode #navbar { top: 44px; }
body.edit-mode #hero { padding-top: calc(var(--nav-h) + 44px + 40px); }

/* Nav right */
.nav-right { display: flex; align-items: center; gap: 10px; }

/* Editable element highlight in edit mode */
body.edit-mode [data-key] {
  outline: 2px dashed rgba(88, 166, 255, 0.35);
  border-radius: 4px;
  cursor: text;
  transition: outline .15s, background .15s;
  min-width: 20px;
  display: inline-block;
}
body.edit-mode [data-key]:hover {
  outline: 2px solid var(--accent);
  background: rgba(88, 166, 255, 0.06);
}
body.edit-mode [data-key]:focus {
  outline: 2px solid var(--accent);
  background: rgba(88, 166, 255, 0.1);
}

/* Paragraphs and block elements need block display */
body.edit-mode p[data-key],
body.edit-mode h1[data-key],
body.edit-mode h3[data-key],
body.edit-mode li[data-key],
body.edit-mode footer p[data-key] {
  display: block;
}

/* Toast notification */
#toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--accent2);
  color: #0d1117;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: .88rem;
  font-weight: 600;
  z-index: 9999;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .25s, transform .25s;
  pointer-events: none;
}
#toast.show { opacity: 1; transform: translateY(0); }

/* ===== FADE-IN ANIMATION ===== */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .5s ease, transform .5s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}
