/* ===== Design Tokens ===== */
:root {
  --bg: #f6f7fb;
  --bg-alt: #ffffff;
  --surface: #ffffff;
  --text: #0f172a;
  --text-muted: #475569;
  --border: #e2e8f0;
  --primary: #6366f1;
  --primary-glow: #8b5cf6;
  --accent: #06b6d4;
  --gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 12px 32px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 24px 64px rgba(99, 102, 241, 0.18);
  --radius: 14px;
  --radius-lg: 22px;
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg: #0a0e1a;
  --bg-alt: #0f1424;
  --surface: #151b2e;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #1e293b;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 24px 64px rgba(99, 102, 241, 0.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }

/* ===== Preloader ===== */
.preloader {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.preloader.hidden { opacity: 0; visibility: hidden; }
.loader { display: flex; gap: 0.5rem; }
.loader span {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--gradient);
  animation: bounce 1.4s ease-in-out infinite;
}
.loader span:nth-child(2) { animation-delay: 0.2s; }
.loader span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce {
  0%, 80%, 100% { transform: scale(0.4); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}

/* ===== Navbar ===== */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 1.25rem 0;
  transition: all var(--transition);
}
.navbar.scrolled {
  padding: 0.75rem 0;
  background: rgba(var(--bg-rgb, 246, 247, 251), 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.logo { display: flex; align-items: center; gap: 0.5rem; font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; }
.logo-mark {
  background: var(--gradient);
  color: #fff;
  padding: 0.3rem 0.5rem;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
.logo-text span { background: var(--gradient); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.nav-links { display: flex; gap: 2rem; }
.nav-links a {
  position: relative; font-weight: 500; font-size: 0.95rem;
  color: var(--text-muted); transition: color var(--transition);
}
.nav-links a::after {
  content: ''; position: absolute; bottom: -6px; left: 0;
  width: 0; height: 2px; background: var(--gradient);
  transition: width var(--transition);
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.nav-links a.active { color: var(--text); }

.nav-actions { display: flex; align-items: center; gap: 0.75rem; }
.theme-toggle {
  width: 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: all var(--transition);
}
.theme-toggle:hover { transform: rotate(15deg); border-color: var(--primary); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

.menu-toggle { display: none; flex-direction: column; gap: 5px; padding: 8px; }
.menu-toggle span {
  width: 24px; height: 2px; background: var(--text);
  border-radius: 2px; transition: all var(--transition);
}
.menu-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.9rem 1.75rem;
  border-radius: 999px;
  font-weight: 600; font-size: 0.95rem;
  transition: all var(--transition);
  cursor: pointer;
}
.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: var(--shadow-md);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }

/* ===== Hero ===== */
.hero {
  min-height: 100vh;
  display: flex; align-items: center;
  position: relative; overflow: hidden;
  padding: 6rem 0 4rem;
}
.hero-bg { position: absolute; inset: 0; overflow: hidden; z-index: 0; }
.orb {
  position: absolute; border-radius: 50%;
  filter: blur(80px); opacity: 0.4;
  animation: float 20s ease-in-out infinite;
}
.orb-1 { width: 500px; height: 500px; background: var(--primary); top: -100px; right: -100px; }
.orb-2 { width: 400px; height: 400px; background: var(--accent); bottom: -100px; left: -100px; animation-delay: -10s; }
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(50px, -50px) scale(1.1); }
}
.grid-overlay {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.15;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
}
.hero-inner { position: relative; z-index: 1; text-align: center; max-width: 800px; }
.eyebrow { font-family: var(--font-mono); color: var(--primary); margin-bottom: 1rem; font-size: 0.95rem; }
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}
.hero-subtitle {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 600;
  background: var(--gradient);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: 1.5rem;
}
.hero-tagline {
  font-size: 1.15rem; color: var(--text-muted);
  max-width: 600px; margin: 0 auto 2.5rem;
}
.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-bottom: 4rem; }
.hero-stats {
  display: flex; gap: 3rem; justify-content: center; flex-wrap: wrap;
  padding-top: 2rem; border-top: 1px solid var(--border);
}
.hero-stats div { text-align: center; }
.hero-stats strong { display: block; font-family: var(--font-display); font-size: 2rem; font-weight: 700; }
.hero-stats span { font-size: 0.85rem; color: var(--text-muted); }

.scroll-indicator {
  position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
  width: 24px; height: 40px; border: 2px solid var(--text-muted);
  border-radius: 12px; display: flex; justify-content: center; padding-top: 6px;
}
.scroll-indicator span {
  width: 4px; height: 8px; background: var(--text-muted); border-radius: 2px;
  animation: scrollDown 1.5s ease-in-out infinite;
}
@keyframes scrollDown {
  0% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(15px); opacity: 0; }
}

/* ===== Sections ===== */
.section { padding: 6rem 0; position: relative; }
.section-alt { background: var(--bg-alt); }
.section-head { text-align: center; margin-bottom: 4rem; }
.section-label {
  font-family: var(--font-mono);
  color: var(--primary);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}
.section-text { color: var(--text-muted); margin-bottom: 1rem; font-size: 1.05rem; }

/* ===== About ===== */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; }
.about-card {
  background: #0a0e1a;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.terminal-header {
  background: #1a2138;
  padding: 0.75rem 1rem;
  display: flex; align-items: center; gap: 0.4rem;
}
.terminal-header span {
  width: 12px; height: 12px; border-radius: 50%;
  background: #ff5f56;
}
.terminal-header span:nth-child(2) { background: #ffbd2e; }
.terminal-header span:nth-child(3) { background: #27c93f; }
.terminal-header p { margin-left: auto; font-family: var(--font-mono); font-size: 0.8rem; color: #94a3b8; }
.terminal-body {
  padding: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: #e2e8f0;
  line-height: 1.8;
  white-space: pre-wrap;
}
.t-c { color: #06b6d4; }
.t-g { color: #4ade80; }
.t-y { color: #fbbf24; }

.skills-pills { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.5rem 0; }
.skills-pills li {
  padding: 0.4rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: var(--font-mono);
  transition: all var(--transition);
}
.skills-pills li:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  color: var(--primary);
}

/* ===== Skills ===== */
.skills-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.skill-category {
  background: var(--surface);
  padding: 2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}
.skill-category:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.skill-category h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border);
}
.skill { margin-bottom: 1.25rem; }
.skill-meta { display: flex; justify-content: space-between; margin-bottom: 0.5rem; font-size: 0.9rem; font-weight: 500; }
.bar { height: 8px; background: var(--border); border-radius: 999px; overflow: hidden; }
.fill {
  height: 100%; width: 0;
  background: var(--gradient);
  border-radius: 999px;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Projects ===== */
.projects-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.project-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  display: flex; flex-direction: column;
}
.project-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}
/* .project-img {
  aspect-ratio: 16/10;
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.project-img span {
  font-family: var(--font-display);
  font-size: 4rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
}
.project-img::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.2), transparent);
} */
.project-body { padding: 1.5rem; flex: 1; display: flex; flex-direction: column; }
.project-body h3 { font-family: var(--font-display); font-size: 1.35rem; margin-bottom: 0.5rem; }
.project-body p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 1rem; flex: 1; }
.tech { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }
.tech span {
  padding: 0.25rem 0.7rem;
  background: var(--bg);
  border-radius: 6px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--primary);
  border: 1px solid var(--border);
}
.project-links { display: flex; gap: 1.25rem; padding-top: 0.75rem; border-top: 1px solid var(--border); }
.project-links a { font-size: 0.9rem; font-weight: 500; color: var(--text); transition: color var(--transition); }
.project-links a:hover { color: var(--primary); }

/* ===== Timeline ===== */
.timeline { position: relative; max-width: 800px; margin: 0 auto; padding-left: 2rem; }
.timeline::before {
  content: ''; position: absolute; left: 8px; top: 0; bottom: 0;
  width: 2px; background: var(--gradient);
}
.t-item { position: relative; margin-bottom: 2.5rem; }
.t-dot {
  position: absolute; left: -2rem; top: 6px;
  width: 18px; height: 18px;
  background: var(--surface);
  border: 3px solid var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--bg-alt);
}
.t-content {
  background: var(--surface);
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}
.t-content:hover { transform: translateX(6px); box-shadow: var(--shadow-md); }
.t-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 500;
}
.t-content h3 { font-family: var(--font-display); font-size: 1.15rem; margin: 0.5rem 0; }
.t-content p { color: var(--text-muted); font-size: 0.95rem; }

/* ===== Services ===== */
.services-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.service-card {
  background: var(--surface);
  padding: 2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  text-align: center;
  transition: all var(--transition);
  position: relative; overflow: hidden;
}
.service-card::before {
  content: ''; position: absolute; inset: 0;
  background: var(--gradient);
  opacity: 0; transition: opacity var(--transition);
  z-index: 0;
}
.service-card:hover { transform: translateY(-8px); border-color: transparent; box-shadow: var(--shadow-lg); }
.service-card:hover::before { opacity: 1; }
.service-card:hover h3, .service-card:hover p, .service-card:hover .service-icon { color: #fff; position: relative; z-index: 1; }
.service-card > * { position: relative; z-index: 1; transition: color var(--transition); }
.service-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.service-card h3 { font-family: var(--font-display); font-size: 1.2rem; margin-bottom: 0.75rem; }
.service-card p { color: var(--text-muted); font-size: 0.95rem; }

/* ===== Contact ===== */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: start; }
.contact-info { margin: 2rem 0; }
.contact-info p { font-size: 1rem; margin-bottom: 0.5rem; color: var(--text-muted); }
.contact-info strong { color: var(--text); margin-right: 0.5rem; }
.socials { display: flex; gap: 0.75rem; }
.socials a {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all var(--transition);
  color: var(--text-muted);
}
.socials a:hover { background: var(--gradient); color: #fff; transform: translateY(-3px); border-color: transparent; }
.socials svg { width: 20px; height: 20px; }

.contact-form {
  background: var(--surface);
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}
.field { margin-bottom: 1.25rem; }
.field label { display: block; margin-bottom: 0.5rem; font-weight: 500; font-size: 0.9rem; }
.field input, .field textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
  transition: all var(--transition);
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent);
}
.field textarea { resize: vertical; }
.error { display: block; color: #ef4444; font-size: 0.8rem; margin-top: 0.4rem; min-height: 1em; }
.form-success {
  margin-top: 1rem; padding: 0.85rem;
  background: color-mix(in srgb, #10b981 15%, transparent);
  color: #10b981;
  border-radius: var(--radius);
  text-align: center; font-weight: 500;
  display: none;
}
.form-success.show { display: block; animation: fadeInUp 0.4s ease; }

/* ===== Footer ===== */
.footer { background: var(--bg-alt); border-top: 1px solid var(--border); padding: 4rem 0 1.5rem; }
.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 3rem; padding-bottom: 2rem; }
.footer-tag { color: var(--text-muted); margin-top: 1rem; font-size: 0.9rem; }
.footer-links h4 { font-family: var(--font-display); margin-bottom: 1rem; font-size: 1rem; }
.footer-links a { display: block; color: var(--text-muted); padding: 0.3rem 0; transition: color var(--transition); font-size: 0.9rem; }
.footer-links a:hover { color: var(--primary); }
.footer-bottom { padding-top: 1.5rem; border-top: 1px solid var(--border); text-align: center; color: var(--text-muted); font-size: 0.85rem; }

/* ===== Scroll to top ===== */
.scroll-top {
  position: fixed; bottom: 2rem; right: 2rem;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  font-size: 1.5rem; font-weight: 700;
  box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden;
  transform: translateY(20px);
  transition: all var(--transition);
  z-index: 90;
}
.scroll-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.scroll-top:hover { transform: translateY(-4px); }

/* ===== Reveal Animations ===== */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ===== Responsive ===== */
@media (max-width: 968px) {
  .about-grid, .contact-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .skills-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .menu-toggle { display: flex; }
  .nav-links {
    position: fixed; top: 0; right: -100%;
    width: 75%; max-width: 320px; height: 100vh;
    background: var(--surface);
    flex-direction: column;
    padding: 6rem 2rem 2rem;
    gap: 1.5rem;
    box-shadow: var(--shadow-lg);
    transition: right var(--transition);
  }
  .nav-links.open { right: 0; }
  .hero-stats { gap: 2rem; }
  .projects-grid, .services-grid, .footer-inner { grid-template-columns: 1fr; }
  .section { padding: 4rem 0; }
  .timeline { padding-left: 1.5rem; }
  .contact-form { padding: 1.75rem; }
}


/* skills tools */

.skill-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

.skill-list li {
  padding: 0.5rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.85rem;
  font-family: var(--font-mono);
  color: var(--text);
  transition: all var(--transition);
}

.skill-list li:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
}

/* project images */

/* .project-img {
  width: 100%;
  aspect-ratio: 16/10;
  overflow: hidden;
  position: relative;
}

.project-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
} */
.project-img {
  aspect-ratio: 16/10;
  width: 100%;
  overflow: hidden;
  position: relative;
  background: var(--bg-alt);
}

.project-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.project-card:hover .project-img img {
  transform: scale(1.05);
}