/* ===== CSS Custom Properties ===== */
:root {
  --bg: #0a0a0f;
  --bg-2: #111118;
  --bg-card: #16161f;
  --border: rgba(255, 255, 255, 0.08);
  --text: #e8e8f0;
  --text-muted: #888898;
  --accent: #6366f1;
  --accent-2: #8b5cf6;
  --accent-3: #06b6d4;
  --gradient: linear-gradient(135deg, #6366f1, #8b5cf6, #06b6d4);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 32px rgba(0, 0, 0, 0.4);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

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

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

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

ul { list-style: none; }

input, textarea, select, button {
  font-family: inherit;
  font-size: inherit;
}

/* ===== Utility ===== */
.container {
  width: 100%;
  max-width: 1140px;
  margin-inline: auto;
  padding-inline: 24px;
}

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

/* ===== Navbar ===== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 0;
  transition: background var(--transition), border-bottom-color var(--transition);
}

.navbar.scrolled {
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 40px;
  height: 72px;
}

.logo {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  transition: opacity var(--transition);
}
.logo:hover { opacity: 0.75; }
.logo-bracket { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 32px;
  margin-left: auto;
}

.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: -4px; left: 0;
  width: 0; height: 2px;
  background: var(--accent);
  transition: width var(--transition);
  border-radius: 2px;
}

.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }

.nav-cta { margin-left: 8px; }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin-left: auto;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
}

.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.35);
}

.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-2px);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
  border-radius: var(--radius);
}

.btn-full { width: 100%; }

/* ===== Hero ===== */
.hero {
  min-height: 100svh;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 64px;
  padding-top: 80px;
  padding-inline: 24px;
  max-width: 1140px;
  margin-inline: auto;
  position: relative;
}

.hero-glow {
  position: fixed;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(ellipse, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

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

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  color: #a5b4fc;
  margin-bottom: 24px;
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.5);
  animation: pulse-dot 2s ease-out infinite;
}

@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

.hero-title {
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.04em;
  margin-bottom: 24px;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 520px;
  margin-bottom: 40px;
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 64px;
}

.hero-stats {
  display: flex;
  gap: 0;
  align-items: center;
}

.stat {
  display: flex;
  flex-direction: column;
  padding-inline: 32px;
}

.stat:first-child { padding-left: 0; }

.stat-number {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}

.stat-suffix {
  font-size: 1.5rem;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  vertical-align: super;
  line-height: 0;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.stat-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
}

/* ===== Phone Mockup ===== */
.hero-phone {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.phone-frame {
  width: 240px;
  height: 490px;
  background: #1a1a24;
  border-radius: 40px;
  border: 2px solid rgba(255,255,255,0.12);
  position: relative;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.5),
    0 40px 80px rgba(0,0,0,0.6),
    inset 0 1px 0 rgba(255,255,255,0.1);
}

.phone-notch {
  width: 90px;
  height: 24px;
  background: #0a0a0f;
  border-radius: 0 0 16px 16px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.phone-screen {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, #13131e 0%, #0d0d18 100%);
  padding: 0 12px 20px;
}

.screen-ui {
  padding-top: 8px;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.screen-header { margin-bottom: 4px; }

.screen-status-bar {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: rgba(255,255,255,0.5);
  padding: 0 4px;
  margin-bottom: 12px;
}

.screen-app-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  padding: 0 4px;
}

.screen-card {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 12px;
  height: 100px;
  animation: card-shimmer 3s ease-in-out infinite;
}

.screen-card--sm { height: 56px; animation-delay: 0.5s; }
.screen-card--sm + .screen-card--sm { animation-delay: 1s; }

@keyframes card-shimmer {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

.screen-fab {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gradient);
  margin-left: auto;
  margin-top: auto;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.5);
}

/* ===== Sections ===== */
.section {
  padding-block: 100px;
}

.section--dark {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-header {
  text-align: center;
  margin-bottom: 64px;
}

.section-label {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.section-header h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 16px;
}

.section-header p {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 560px;
  margin-inline: auto;
}

/* ===== Cards ===== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  cursor: default;
  outline: none;
}

.card:hover, .card:focus-visible {
  border-color: rgba(99, 102, 241, 0.35);
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(99, 102, 241, 0.15);
}

.card-icon {
  width: 48px;
  height: 48px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: var(--accent);
  transition: background var(--transition);
}

.card-icon svg { width: 22px; height: 22px; }

.card:hover .card-icon {
  background: rgba(99, 102, 241, 0.2);
}

.card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ===== Process ===== */
.process-steps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 32px;
  counter-reset: step;
}

.process-step {
  position: relative;
  padding: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.step-number {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 0.5;
  line-height: 1;
  margin-bottom: 12px;
}

.step-content h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.step-content p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ===== Skills ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 20px 40px;
  margin-bottom: 40px;
}

.skill-bar-wrap { width: 100%; }

.skill-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text);
}

.skill-meta span:last-child { color: var(--text-muted); }

.skill-bar {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  overflow: hidden;
}

.skill-fill {
  height: 100%;
  width: 0;
  background: var(--gradient);
  border-radius: 999px;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tech-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.badge {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-card);
  transition: all var(--transition);
}

.badge:hover {
  border-color: rgba(99, 102, 241, 0.4);
  color: var(--text);
  background: rgba(99, 102, 241, 0.08);
}

/* ===== CTA Section ===== */
.cta-section {
  position: relative;
  overflow: hidden;
  text-align: center;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
}

.cta-glow {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 300px;
  background: radial-gradient(ellipse, rgba(99, 102, 241, 0.18) 0%, transparent 70%);
  pointer-events: none;
}

.cta-content {
  position: relative;
  z-index: 1;
  max-width: 600px;
}

.cta-content h2 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.cta-content p {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 40px;
}

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

.contact-form { display: flex; flex-direction: column; gap: 20px; }

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.form-group label span { color: var(--accent); }

.form-group input,
.form-group textarea,
.form-group select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
  -webkit-appearance: none;
  outline: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder { color: rgba(136, 136, 152, 0.5); }

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-group input.invalid,
.form-group textarea.invalid {
  border-color: #f87171;
}

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

.field-error {
  font-size: 0.8rem;
  color: #f87171;
  min-height: 16px;
}

.form-success {
  display: none;
  padding: 16px;
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.3);
  border-radius: var(--radius-sm);
  color: #4ade80;
  font-size: 0.9rem;
  text-align: center;
}

.form-success.visible { display: block; }

.btn-loading {
  display: none;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn.loading .btn-text { display: none; }
.btn.loading .btn-loading { display: block; }

@keyframes spin { to { transform: rotate(360deg); } }

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

.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.contact-card h3 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

.contact-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color var(--transition);
}

.contact-link:hover { color: var(--accent); }
.contact-link svg { width: 18px; height: 18px; flex-shrink: 0; }

.availability-dot {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: #4ade80;
  margin-top: 12px;
  font-weight: 500;
}

.dot-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  flex-shrink: 0;
  animation: pulse-dot 2s ease-out infinite;
}

/* ===== Footer ===== */
.footer {
  border-top: 1px solid var(--border);
  padding-block: 32px;
  background: var(--bg-2);
}

.footer-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-copy {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-left: auto;
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: color var(--transition);
}

.footer-links a:hover { color: var(--text); }

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 110px;
    padding-bottom: 80px;
  }

  .hero-phone { display: none; }

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

@media (max-width: 768px) {
  .nav-links, .nav-cta { display: none; }

  .hamburger { display: flex; }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: fixed;
    top: 72px; left: 0; right: 0;
    background: rgba(10, 10, 15, 0.97);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px 24px;
  }

  .nav-links.open li a {
    display: block;
    padding: 12px 0;
    font-size: 1rem;
    border-bottom: 1px solid var(--border);
  }

  .hero-actions { flex-direction: column; }

  .hero-stats {
    flex-direction: row;
    gap: 0;
  }

  .stat { padding-inline: 20px; }
  .stat:first-child { padding-left: 0; }

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

  .skills-grid { grid-template-columns: 1fr; }

  .process-steps { grid-template-columns: 1fr; }

  .footer-inner { justify-content: center; text-align: center; }
  .footer-copy { margin: 0; width: 100%; order: 3; }
}

@media (max-width: 480px) {
  .hero-stats { flex-direction: column; gap: 16px; align-items: flex-start; }
  .stat-divider { display: none; }
  .stat { padding: 0; }
}

/* ===== Focus Styles (Accessibility) ===== */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
