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

/* ===== VARIABLES ===== */
:root {
  --primary:       #059669;
  --primary-dark:  #047857;
  --primary-light: #10b981;
  --primary-glow:  rgba(5, 150, 105, 0.12);

  --bg:      #ffffff;
  --bg-alt:  #f8fafc;
  --bg-card: #ffffff;
  --bg-nav:  rgba(255, 255, 255, 0.92);

  --text:       #111827;
  --text-muted: #6b7280;
  --text-light: #9ca3af;

  --border:    #e5e7eb;
  --radius:    0.875rem;
  --radius-sm: 0.5rem;

  --shadow:    0 4px 12px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.12);

  --transition: 0.22s ease;
  --nav-h: 4rem;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

[data-theme="dark"] {
  --bg:      #0f172a;
  --bg-alt:  #1e293b;
  --bg-card: #1e293b;
  --bg-nav:  rgba(15, 23, 42, 0.94);
  --text:       #f1f5f9;
  --text-muted: #94a3b8;
  --text-light: #64748b;
  --border:  #334155;
  --shadow:    0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.45);
}

/* ===== BASE ===== */
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}

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

/* ===== LAYOUT ===== */
.container { max-width: 1140px; margin: 0 auto; padding: 0 1.5rem; }
section { padding: 5.5rem 0; }

/* ===== SECTION TYPOGRAPHY ===== */
.section-label {
  display: inline-block;
  font-size: 0.775rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.625rem;
}

.section-title {
  font-size: clamp(1.75rem, 3vw, 2.375rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 0.875rem;
}

.section-desc {
  font-size: 1.0625rem;
  color: var(--text-muted);
  max-width: 540px;
  line-height: 1.7;
}

/* ===== NAV ===== */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--bg-nav);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  z-index: 1000;
  transition: border-color var(--transition), box-shadow var(--transition);
}

nav.scrolled {
  border-color: var(--border);
  box-shadow: var(--shadow);
}

.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 1.1875rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.03em;
}
.nav-logo span { color: var(--text); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.125rem;
}

.nav-links a {
  padding: 0.375rem 0.875rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition), background var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
  background: var(--primary-glow);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.theme-toggle {
  width: 2.125rem;
  height: 2.125rem;
  border-radius: var(--radius-sm);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  transition: all var(--transition);
}
.theme-toggle:hover { color: var(--primary); border-color: var(--primary); }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 2.125rem;
  height: 2.125rem;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0.375rem;
}
.hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all var(--transition);
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav drawer */
.mobile-nav {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0;
  background: var(--bg-nav);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 0.875rem 1.5rem 1.25rem;
  flex-direction: column;
  gap: 0.25rem;
  z-index: 999;
  box-shadow: var(--shadow);
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  color: var(--text-muted);
  transition: all var(--transition);
}
.mobile-nav a:hover,
.mobile-nav a.active { color: var(--primary); background: var(--primary-glow); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6875rem 1.625rem;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 600;
  border: 2px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(5, 150, 105, 0.32);
}

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

.btn-ghost {
  background: var(--bg-alt);
  color: var(--text-muted);
  border-color: var(--border);
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}
.btn-ghost:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-glow);
}

/* ===== HERO ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: var(--bg);
  padding-top: var(--nav-h);
  position: relative;
  overflow: hidden;
}

/* Subtle radial glow */
.hero::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -15%;
  width: 65vmax;
  height: 65vmax;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 60%);
  pointer-events: none;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4rem;
  align-items: center;
  width: 100%;
}

.hero-greeting {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.875rem;
}
.hero-greeting::before {
  content: '';
  display: block;
  width: 1.75rem;
  height: 2px;
  background: var(--primary);
  border-radius: 1px;
}

.hero-name {
  font-size: clamp(2.75rem, 5.5vw, 4.25rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: var(--text);
  margin-bottom: 0.875rem;
}

.hero-role {
  font-size: clamp(1.125rem, 2.5vw, 1.3125rem);
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  min-height: 2em;
}

.cursor {
  display: inline-block;
  width: 2px;
  height: 1.15em;
  background: var(--primary);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink 0.85s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-bio {
  font-size: 1.0625rem;
  color: var(--text-muted);
  line-height: 1.75;
  max-width: 500px;
  margin-bottom: 2.25rem;
}

.hero-actions {
  display: flex;
  gap: 0.875rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.hero-stats {
  display: flex;
  gap: 2.5rem;
}

.stat-number {
  font-size: 1.875rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* Photo card */
.hero-photo { position: relative; flex-shrink: 0; }

.photo-frame {
  width: 270px;
  height: 315px;
  border-radius: 1.75rem;
  overflow: hidden;
  position: relative;
  z-index: 1;
  box-shadow: var(--shadow-lg);
}
.photo-frame img { width: 100%; height: 100%; object-fit: cover; }

.hero-photo::before {
  content: '';
  position: absolute;
  inset: 1.25rem -1.25rem -1.25rem 1.25rem;
  border: 2px solid var(--primary);
  border-radius: 1.75rem;
  opacity: 0.25;
}

/* Scroll indicator */
.scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  color: var(--text-light);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  animation: bob 2s ease-in-out infinite;
}
.scroll-hint i { font-size: 1rem; }
@keyframes bob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(6px); }
}

/* ===== ABOUT ===== */
.about { background: var(--bg-alt); }

.about-grid {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: 4.5rem;
  align-items: center;
  margin-top: 0;
}

.about-img-col { position: relative; }

.about-img-col img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

.about-img-col::after {
  content: '';
  position: absolute;
  inset: 1.25rem -1.25rem -1.25rem 1.25rem;
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  opacity: 0.2;
  pointer-events: none;
}

.about-text-col .section-title { margin-top: 0.25rem; }

.about-p {
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 1.125rem;
  font-size: 1.0125rem;
}

.about-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

/* ===== SKILLS ===== */
.skills { background: var(--bg); }

.skills-head { margin-bottom: 3rem; }

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.skill-group {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.625rem;
  transition: box-shadow var(--transition), transform var(--transition);
}
.skill-group:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.skill-group-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1.125rem;
}
.skill-group-title i { color: var(--primary); width: 1rem; text-align: center; }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4375rem;
}

.chip {
  background: var(--bg-alt);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.3125rem 0.75rem;
  border-radius: 2rem;
  font-size: 0.8125rem;
  font-weight: 500;
  transition: all var(--transition);
}
.chip:hover {
  background: var(--primary-glow);
  border-color: var(--primary);
  color: var(--primary);
}

/* ===== PROJECTS ===== */
.projects { background: var(--bg-alt); }

.projects-head { margin-bottom: 3rem; }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), box-shadow var(--transition);
}
.project-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.project-banner {
  height: 120px;
  background: linear-gradient(135deg, var(--c1, var(--primary)), var(--c2, var(--primary-dark)));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.project-banner::after {
  content: '';
  position: absolute;
  bottom: -35%;
  right: -8%;
  width: 180px;
  height: 180px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 50%;
}
.project-banner i {
  font-size: 2.25rem;
  color: rgba(255, 255, 255, 0.9);
  position: relative;
  z-index: 1;
}

.project-body {
  padding: 1.375rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.project-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.project-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
  flex: 1;
  margin-bottom: 1.125rem;
}

.project-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 1.125rem;
}

.tag {
  background: var(--bg-alt);
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0.2rem 0.5625rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.project-actions { display: flex; gap: 0.625rem; }

/* ===== CONTACT ===== */
.contact { background: var(--bg); }

.contact-head { margin-bottom: 3rem; }

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.65fr;
  gap: 4rem;
}

.contact-info-title {
  font-size: 1.1875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.375rem;
}

.contact-info-sub {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
  line-height: 1.6;
}

.contact-items { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1.75rem; }

.contact-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.75rem 1rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition);
}
.contact-item:hover { border-color: var(--primary); }

.contact-item i {
  color: var(--primary);
  font-size: 1rem;
  width: 1.125rem;
  text-align: center;
  flex-shrink: 0;
}

.contact-item a,
.contact-item span {
  font-size: 0.9375rem;
  color: var(--text);
  transition: color var(--transition);
}
.contact-item a:hover { color: var(--primary); }

.social-row { display: flex; gap: 0.625rem; }

.social-btn {
  width: 2.375rem;
  height: 2.375rem;
  border-radius: var(--radius-sm);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.0625rem;
  transition: all var(--transition);
}
.social-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-glow);
  transform: translateY(-2px);
}

/* Contact form */
.contact-form { display: flex; flex-direction: column; gap: 1rem; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.form-group { display: flex; flex-direction: column; gap: 0.3125rem; }

.form-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}

.form-group input,
.form-group textarea {
  padding: 0.6875rem 0.9375rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9375rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-light); }

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-group textarea { min-height: 130px; resize: vertical; }

.form-status {
  font-size: 0.875rem;
  padding: 0.625rem 0.9375rem;
  border-radius: var(--radius-sm);
  display: none;
}
.form-status.success { background: #d1fae5; color: #065f46; display: block; }
.form-status.error   { background: #fee2e2; color: #991b1b; display: block; }

/* ===== FOOTER ===== */
footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 1.75rem 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-copy { font-size: 0.875rem; color: var(--text-muted); }
.footer-socials { display: flex; gap: 0.5rem; }

/* ===== BACK TO TOP ===== */
.back-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 2.375rem;
  height: 2.375rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition);
  z-index: 998;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.4);
}
.back-top.visible { opacity: 1; pointer-events: auto; }
.back-top:hover { transform: translateY(-3px); background: var(--primary-dark); }

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

/* ===== RESPONSIVE ===== */
@media (max-width: 960px) {
  .hero-inner  { grid-template-columns: 1fr; }
  .hero-photo  { display: none; }
  .about-grid  { grid-template-columns: 1fr; gap: 2.5rem; }
  .contact-grid { grid-template-columns: 1fr; gap: 2.5rem; }
}

@media (max-width: 768px) {
  section { padding: 3.75rem 0; }
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .projects-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .hero-stats { gap: 1.75rem; }
}

@media (max-width: 480px) {
  .hero-actions { flex-direction: column; }
  .btn { justify-content: center; }
  .about-img-col { display: none; }
  .footer-inner { flex-direction: column; text-align: center; }
}
