:root {
  --bg-dark: #09090b;
  --bg-card: rgba(24, 24, 27, 0.6);
  --text-main: #f4f4f5;
  --text-muted: #a1a1aa;
  --accent-1: #8b5cf6;
  --accent-2: #ec4899;
  --accent-glow: rgba(139, 92, 246, 0.5);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-bg: rgba(9, 9, 11, 0.65);
  --font-mono: 'JetBrains Mono', monospace;
  --font-sans: 'Inter', sans-serif;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.6;
}

html {
  scroll-behavior: smooth;
}

h1, h2, h3, h4 {
  font-family: var(--font-sans);
  margin: 0;
  line-height: 1.2;
}

a { color: inherit; text-decoration: none; }

.gradient-text {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
  padding: 1rem 2rem;
  transition: all 0.3s ease;
}
.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.nav-logo {
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.5px;
}
.nav-logo .dot { color: var(--accent-1); }
.nav-links {
  display: flex;
  gap: 2rem;
}
.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.3s ease;
}
.nav-links a:hover { color: var(--text-main); }
.hamburger { display: none; background: none; border: none; cursor: pointer; flex-direction: column; gap: 5px; }
.hamburger span { display: block; width: 25px; height: 2px; background: var(--text-main); transition: 0.3s; }

/* Hero */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6rem 2rem 2rem;
  text-align: center;
  overflow: hidden;
}
.hero-bg-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--glass-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--glass-border) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.2;
  mask-image: linear-gradient(to bottom, transparent, black 20%, black 80%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 20%, black 80%, transparent);
}
.hero-glow {
  position: absolute;
  width: 600px; height: 600px;
  background: var(--accent-1);
  filter: blur(150px);
  border-radius: 50%;
  opacity: 0.15;
  z-index: 0;
  animation: pulse 8s alternate infinite;
}
.glow-1 { top: -10%; left: -10%; background: var(--accent-1); }
.glow-2 { bottom: -10%; right: -10%; background: var(--accent-2); animation-delay: -4s; }

@keyframes pulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.2); }
}

.hero-content {
  position: relative;
  z-index: 10;
  max-width: 800px;
}
.hero-eyebrow {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 50px;
  background: var(--glass-border);
  border: 1px solid var(--glass-border);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 2rem;
  color: var(--text-muted);
}
.hero-headline {
  font-size: clamp(3rem, 5vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 1.5rem;
}
.hero-subtext {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  color: var(--accent-1);
  margin-bottom: 1.5rem;
  height: 30px;
}

.cursor {
  display: inline-block;
  width: 3px;
  background-color: var(--accent-1);
  animation: blink 1s infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.hero-bio {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 3rem;
}
.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
}
.btn {
  padding: 0.8rem 1.75rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  color: white;
  box-shadow: 0 4px 15px var(--accent-glow);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(236, 72, 153, 0.4);
}
.btn-ghost {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--glass-border);
}
.btn-ghost:hover {
  background: var(--glass-border);
}
.hero-scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 50px;
  border: 2px solid var(--text-muted);
  border-radius: 15px;
  display: flex;
  justify-content: center;
}
.scroll-dot {
  width: 4px;
  height: 8px;
  background: var(--text-muted);
  border-radius: 4px;
  margin-top: 8px;
  animation: scrollDown 2s infinite;
}
@keyframes scrollDown {
  0% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(20px); opacity: 0; }
}

/* Sections Global */
.section {
  padding: 8rem 2rem;
  position: relative;
}
.container {
  max-width: 1200px;
  margin: 0 auto;
}
.section-label {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-1);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 1rem;
}
.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  margin-bottom: 1rem;
}
.section-sub {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 4rem;
  max-width: 600px;
}

/* About Section */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}
.about-text h2 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
}
.about-text p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
}
.about-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}
.tag {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--text-main);
}
.about-cards {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.mini-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  padding: 2rem;
  border-radius: 16px;
  transition: transform 0.3s ease, border-color 0.3s ease;
}
.mini-card:hover {
  transform: translateX(10px);
  border-color: var(--accent-1);
}
.mini-card-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
}
.mini-card h4 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}
.mini-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0;
}

/* Results */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}
.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  padding: 2.5rem 2rem;
  border-radius: 20px;
  text-align: center;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}
.metric-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  transform: scaleX(0);
  transition: transform 0.4s ease;
  transform-origin: left;
}
.metric-card:hover::before {
  transform: scaleX(1);
}
.metric-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.metric-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.metric-value { font-size: 3.5rem; font-weight: 800; display: inline-block; line-height: 1; }
.metric-sign { display: inline-block; font-size: 2rem; color: var(--accent-2); font-weight: 800; margin-left: 2px;}
.metric-label { font-size: 1.1rem; font-weight: 600; margin: 1rem 0 0.5rem; }
.metric-desc { font-size: 0.9rem; color: var(--text-muted); }

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
}
.skills-bars { display: flex; flex-direction: column; gap: 1.5rem; }
.skill-item {}
.skill-header { display: flex; justify-content: space-between; margin-bottom: 0.5rem; font-weight: 500; font-size: 0.95rem; }
.skill-pct { font-family: var(--font-mono); color: var(--accent-1); }
.skill-track {
  height: 8px; background: var(--glass-border); border-radius: 4px; overflow: hidden;
}
.skill-bar {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  border-radius: 4px;
  transition: width 1.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.skills-extra h3 { font-size: 1.5rem; margin-bottom: 1.5rem; }
.pill-group { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 3rem; }
.pill { padding: 0.4rem 1rem; border-radius: 20px; background: rgba(255,255,255,0.03); border: 1px solid var(--glass-border); font-size: 0.85rem; color: var(--text-muted); }
.cert-box { background: var(--bg-card); padding: 2rem; border-radius: 16px; border: 1px solid var(--glass-border); }
.cert-box h4 { margin-bottom: 1.5rem; font-size: 1.2rem; }
.cert-item { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; font-size: 0.95rem; }
.cert-item:last-child { margin-bottom: 0; }
.cert-dot { width: 8px; height: 8px; background: var(--accent-2); border-radius: 50%; box-shadow: 0 0 10px var(--accent-2); }

/* Case Studies */
.cases-grid { display: grid; gap: 2rem; }
.case-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 3rem;
  transition: all 0.3s ease;
  cursor: pointer;
}
.case-card:hover {
  border-color: rgba(255,255,255,0.15);
  background: rgba(30, 30, 35, 0.7);
}
.case-card-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem;
}
.case-tag {
  font-family: var(--font-mono); font-size: 0.8rem; padding: 0.3rem 0.8rem; border-radius: 4px;
  background: rgba(139, 92, 246, 0.1); color: var(--accent-1); border: 1px solid rgba(139, 92, 246, 0.2);
}
.tag-paid { background: rgba(59, 130, 246, 0.1); color: #3b82f6; border-color: rgba(59, 130, 246, 0.2); }
.tag-meta { background: rgba(236, 72, 153, 0.1); color: var(--accent-2); border-color: rgba(236, 72, 153, 0.2); }
.case-number { font-family: var(--font-mono); font-size: 2rem; font-weight: 200; color: var(--glass-border); }
.case-card h3 { font-size: 2rem; margin-bottom: 1rem; }
.case-summary { color: var(--text-muted); font-size: 1.1rem; margin-bottom: 2rem; max-width: 800px; }
.case-toggle {
  background: none; border: none; color: var(--text-main); font-family: var(--font-sans); font-weight: 600;
  font-size: 0.95rem; cursor: pointer; padding: 0; display: inline-flex; align-items: center; gap: 0.5rem;
}
.toggle-arrow { transition: transform 0.3s ease; }
.case-card.expanded .toggle-arrow { transform: rotate(180deg); }
.case-details {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-top: 3rem;
  opacity: 0; max-height: 0; overflow: hidden; transition: all 0.5s ease;
}
.case-card.expanded .case-details {
  opacity: 1; max-height: 1000px; padding-top: 2rem; border-top: 1px solid var(--glass-border);
}
.case-block h4 { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem; font-size: 1.1rem; }
.case-block p { color: var(--text-muted); font-size: 0.95rem; }
.results-block { grid-column: 1 / -1; background: rgba(0,0,0,0.2); padding: 2rem; border-radius: 12px; }
.result-pills { display: flex; flex-wrap: wrap; gap: 1rem; }
.result-pill { padding: 0.75rem 1.5rem; background: var(--glass-bg); border: 1px solid var(--accent-1); border-radius: 8px; font-weight: 600; font-size: 1.1rem; color: var(--text-main); }

/* Tools */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.5rem; }
.tool-card {
  background: var(--bg-card); border: 1px solid var(--glass-border); padding: 1.5rem;
  border-radius: 12px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 1rem;
  transition: transform 0.3s, border-color 0.3s;
}
.tool-card:hover { transform: translateY(-5px); border-color: var(--accent-1); }
.tool-icon { font-size: 2.5rem; }
.tool-name { font-weight: 600; font-size: 1rem; }
.tool-level { font-size: 0.8rem; color: var(--text-muted); padding: 0.2rem 0.6rem; background: rgba(255,255,255,0.05); border-radius: 10px; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 4rem; }
.contact-form-wrap { background: var(--bg-card); padding: 3rem; border-radius: 20px; border: 1px solid var(--glass-border); }
.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-size: 0.9rem; font-weight: 500; color: var(--text-muted); }
.form-group input, .form-group textarea {
  width: 100%; padding: 1rem; border-radius: 8px; background: rgba(0,0,0,0.3); border: 1px solid var(--glass-border);
  color: var(--text-main); font-family: var(--font-sans); font-size: 1rem; transition: border-color 0.3s; box-sizing: border-box;
}
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--accent-1); }
.form-error { display: block; color: var(--accent-2); font-size: 0.8rem; margin-top: 0.5rem; height: 16px; }
.btn-full { width: 100%; padding: 1.2rem; font-size: 1.1rem; margin-top: 1rem; }
.form-success { display: none; margin-top: 1.5rem; padding: 1rem; background: rgba(34, 197, 94, 0.1); color: #4ade80; border-radius: 8px; border: 1px solid rgba(34, 197, 94, 0.2); text-align: center; }
.contact-info { display: flex; flex-direction: column; justify-content: center; }
.info-card { padding: 2rem 0; }
.info-card h3 { font-size: 2rem; margin-bottom: 0.5rem; }
.info-card > p { color: var(--text-muted); margin-bottom: 2rem; line-height: 1.8; }
.social-links { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 2rem; }
.social-btn { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.5rem; background: var(--bg-card); border: 1px solid var(--glass-border); border-radius: 12px; font-weight: 500; transition: all 0.3s; }
.social-btn:hover { background: rgba(255,255,255,0.05); transform: translateX(5px); }
.social-btn span { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; background: rgba(255,255,255,0.1); border-radius: 8px; font-weight: bold; }
.linkedin:hover { border-color: #0a66c2; color: #0a66c2; }
.linkedin:hover span { background: #0a66c2; color: white; }
.email-btn:hover { border-color: var(--accent-1); color: var(--accent-1); }
.email-btn:hover span { background: var(--accent-1); color: white; }
.availability-badge { display: inline-flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1.25rem; background: rgba(34, 197, 94, 0.1); border: 1px solid rgba(34, 197, 94, 0.2); border-radius: 50px; font-size: 0.9rem; color: #4ade80; }
.avail-dot { width: 8px; height: 8px; background: #4ade80; border-radius: 50%; box-shadow: 0 0 10px #4ade80; animation: pulse-green 2s infinite; }

@keyframes pulse-green {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(74, 222, 128, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

/* Footer */
.footer { border-top: 1px solid var(--glass-border); padding: 3rem 2rem; background: rgba(0,0,0,0.3); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; max-width: 1200px; margin: 0 auto; flex-wrap: wrap; gap: 2rem; }
.footer-inner p { color: var(--text-muted); font-size: 0.9rem; margin: 0; }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { color: var(--text-muted); font-size: 0.9rem; transition: color 0.3s; }
.footer-links a:hover { color: var(--text-main); }

/* Back to Top */
.back-top { position: fixed; bottom: 2rem; right: 2rem; width: 50px; height: 50px; border-radius: 50%; background: var(--bg-card); border: 1px solid var(--glass-border); color: var(--text-main); font-size: 1.5rem; display: flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0; visibility: hidden; transition: all 0.3s; z-index: 1000; }
.back-top.visible { opacity: 1; visibility: visible; }
.back-top:hover { background: var(--accent-1); transform: translateY(-5px); }

/* Utilities (Reveal Animation) */
.reveal { opacity: 0; transform: translateY(30px); transition: all 0.8s cubic-bezier(0.5, 0, 0, 1); }
.reveal.active { opacity: 1; transform: translateY(0); }

/* Responsive */
@media (max-width: 900px) {
  .about-grid, .skills-grid, .contact-grid { grid-template-columns: 1fr; }
  .hero-headline { font-size: 2.5rem; }
  .case-details { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .hamburger { display: flex; }
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--bg-dark); border-bottom: 1px solid var(--glass-border);
    flex-direction: column; padding: 2rem; gap: 1.5rem; text-align: center;
    clip-path: circle(0% at top right); transition: all 0.5s ease-out;
  }
  .nav-links.active { clip-path: circle(150% at top right); }
  .hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
  .hamburger.active span:nth-child(2) { opacity: 0; }
  .hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }
}

/* Performance + Cross-Browser Optimizations */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.hero {
  min-height: 100svh;
  min-height: 100dvh;
}

.section {
  content-visibility: auto;
  contain-intrinsic-size: 1px 900px;
}

/* Reduce heavy effects on small/touch devices for faster rendering */
@media (max-width: 900px) {
  .hero-glow {
    filter: blur(90px);
    opacity: 0.1;
  }

  .navbar {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  .section {
    padding: 6rem 1.25rem;
  }

  .container {
    width: min(100%, 1100px);
  }

  .hero-cta {
    flex-direction: column;
    align-items: stretch;
    max-width: 360px;
    margin: 0 auto;
  }

  .btn {
    width: 100%;
  }

  .metric-card,
  .case-card,
  .tool-card,
  .mini-card,
  .contact-form-wrap,
  .info-card {
    padding: 1.1rem;
  }

  .back-top {
    width: 44px;
    height: 44px;
    right: 1rem;
    bottom: 1rem;
  }
}

@media (max-width: 768px) {
  .hero {
    padding-top: 7rem;
  }

  .hero-headline {
    font-size: clamp(2rem, 8vw, 2.6rem);
  }

  .hero-bio,
  .section-sub {
    font-size: 1rem;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-links {
    flex-wrap: wrap;
    gap: 0.9rem;
  }

  .contact-form input,
  .contact-form textarea {
    font-size: 16px;
  }
}

/* Accessibility + battery/perf */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
