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

:root {
  --bg: #0a0a0f;
  --bg-card: #12121a;
  --bg-elevated: #1a1a26;
  --border: rgba(255,255,255,0.06);
  --text: #e8e8ed;
  --text-muted: #8b8b9e;
  --accent: #00d4aa;
  --accent-2: #7c3aed;
  --gradient: linear-gradient(135deg, #00d4aa 0%, #7c3aed 50%, #f472b6 100%);
  --radius: 16px;
  --radius-sm: 10px;
  --nav-h: 72px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }

/* Background effects */
.cursor-glow {
  position: fixed;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,212,170,0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s;
}

.noise {
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none; z-index: 0;
}

/* Nav */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  background: rgba(10,10,15,0.7);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition), box-shadow var(--transition);
}

.nav.scrolled { background: rgba(10,10,15,0.95); box-shadow: 0 4px 30px rgba(0,0,0,0.3); }

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

.logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--text);
  font-weight: 700; font-size: 1.15rem;
}

.logo-mark {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: var(--gradient);
  border-radius: 10px;
  font-size: 0.8rem; font-weight: 800; color: #fff;
}

.logo-text .accent { color: var(--accent); }

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

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem; font-weight: 500;
  transition: color var(--transition);
  position: relative;
}

.nav-links a:not(.nav-cta)::after {
  content: '';
  position: absolute; bottom: -4px; left: 0;
  width: 0; height: 2px;
  background: var(--accent);
  transition: width var(--transition);
}

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

.nav-cta {
  background: var(--gradient) !important;
  color: #fff !important;
  padding: 8px 20px;
  border-radius: 8px;
  font-weight: 600 !important;
}

.nav-toggle {
  display: none;
  flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px;
}

.nav-toggle span {
  display: block; width: 24px; height: 2px;
  background: var(--text);
  transition: var(--transition);
}

/* Hero */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex; align-items: center;
  padding: calc(var(--nav-h) + 40px) 0 80px;
  overflow: hidden;
}

.hero-bg { position: absolute; inset: 0; z-index: 0; }

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  animation: float 8s ease-in-out infinite;
}

.orb-1 {
  width: 500px; height: 500px;
  background: rgba(0,212,170,0.15);
  top: -10%; right: -5%;
}

.orb-2 {
  width: 400px; height: 400px;
  background: rgba(124,58,237,0.12);
  bottom: 10%; left: -10%;
  animation-delay: -4s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -30px) scale(1.05); }
}

.grid-lines {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
}

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

.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 16px;
  background: rgba(0,212,170,0.1);
  border: 1px solid rgba(0,212,170,0.2);
  border-radius: 100px;
  font-size: 0.85rem; color: var(--accent);
  margin-bottom: 24px;
}

.pulse-dot {
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.2rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

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

.hero-subtitle {
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 20px;
  min-height: 2em;
}

.typed-cursor {
  color: var(--accent);
  animation: blink 1s step-end infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.hero-desc {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 600px;
  margin-bottom: 36px;
  line-height: 1.7;
}

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

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem; font-weight: 600;
  text-decoration: none;
  transition: all var(--transition);
  cursor: pointer; border: none;
}

.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 4px 20px rgba(0,212,170,0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0,212,170,0.35);
}

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

.btn-ghost:hover {
  border-color: rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.03);
}

.hero-stats {
  display: flex; align-items: center; gap: 32px;
  padding: 24px 0;
  border-top: 1px solid var(--border);
}

.stat-num {
  font-size: 2rem; font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-suffix {
  font-size: 1.5rem; font-weight: 700;
  color: var(--accent);
}

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

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

.scroll-indicator {
  position: absolute; bottom: 32px; left: 50%;
  transform: translateX(-50%);
  z-index: 1;
}

.mouse {
  width: 24px; height: 38px;
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: 12px;
  display: flex; justify-content: center;
  padding-top: 8px;
}

.wheel {
  width: 3px; height: 8px;
  background: var(--accent);
  border-radius: 2px;
  animation: scroll-wheel 2s ease-in-out infinite;
}

@keyframes scroll-wheel {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(12px); }
}

/* Sections */
.section { padding: 100px 0; position: relative; z-index: 1; }

.section-header { margin-bottom: 56px; }

.section-tag {
  display: inline-block;
  font-size: 0.8rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 12px;
}

.section-header h2 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.section-desc {
  color: var(--text-muted);
  margin-top: 12px;
  font-size: 1.05rem;
}

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

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

.about-text strong { color: var(--text); }

.about-highlights {
  display: flex; flex-direction: column; gap: 20px;
  margin-top: 32px;
}

.highlight {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition);
}

.highlight:hover { border-color: rgba(0,212,170,0.2); }

.highlight-icon { font-size: 1.4rem; }

.highlight h4 { font-size: 0.95rem; margin-bottom: 4px; }
.highlight p { font-size: 0.85rem; color: var(--text-muted); }

.code-window {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.code-header {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}

.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot.red { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green { background: #28c840; }

.code-title {
  margin-left: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.code-body {
  padding: 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  line-height: 1.7;
  overflow-x: auto;
}

.code-body .kw { color: #c678dd; }
.code-body .prop { color: #e5c07b; }
.code-body .str { color: #98c379; }
.code-body .bool { color: #d19a66; }

/* Projects */
.projects { background: linear-gradient(180deg, var(--bg) 0%, #0d0d14 50%, var(--bg) 100%); }

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

.project-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: all var(--transition);
  overflow: hidden;
}

.project-card:hover {
  border-color: rgba(0,212,170,0.25);
  transform: translateY(-4px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.project-card.featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: end;
}

.project-card.featured h3 { grid-column: 1; }
.project-card.featured p { grid-column: 1; max-width: 700px; }
.project-card.featured .project-tech { grid-column: 1; }
.project-card.featured .project-cta { grid-column: 2; grid-row: 2 / 5; align-self: center; }

.project-glow {
  position: absolute; top: -50%; right: -50%;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(0,212,170,0.06) 0%, transparent 70%);
  pointer-events: none;
  transition: opacity var(--transition);
  opacity: 0;
}

.project-card:hover .project-glow { opacity: 1; }

.project-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}

.project-badge {
  font-size: 0.75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 4px 12px;
  background: rgba(124,58,237,0.15);
  color: #a78bfa;
  border-radius: 100px;
}

.project-links a {
  color: var(--text-muted);
  transition: color var(--transition);
}

.project-links a:hover { color: var(--accent); }

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

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

.project-tech {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 16px;
}

.project-tech span {
  font-size: 0.75rem; font-weight: 500;
  padding: 4px 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
}

.project-cta {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem; font-weight: 600;
  transition: gap var(--transition);
}

.project-cta:hover { text-decoration: underline; }

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 48px;
}

.skill-category {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.skill-category h3 {
  font-size: 1rem; font-weight: 700;
  margin-bottom: 24px;
  color: var(--accent);
}

.skill-item { margin-bottom: 18px; }
.skill-item:last-child { margin-bottom: 0; }

.skill-item span {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 8px;
  color: var(--text-muted);
}

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

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

.tech-marquee {
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, black 10%, black 90%, transparent);
}

.marquee-track {
  display: flex; gap: 16px;
  animation: marquee 30s linear infinite;
  width: max-content;
}

.marquee-track span {
  padding: 10px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.85rem; font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Experience */
.timeline { position: relative; padding-left: 32px; }

.timeline::before {
  content: '';
  position: absolute; left: 7px; top: 8px; bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2), transparent);
}

.timeline-item {
  position: relative;
  margin-bottom: 40px;
}

.timeline-item:last-child { margin-bottom: 0; }

.timeline-dot {
  position: absolute; left: -32px; top: 8px;
  width: 16px; height: 16px;
  background: var(--bg);
  border: 3px solid var(--accent);
  border-radius: 50%;
  z-index: 1;
}

.timeline-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  transition: border-color var(--transition);
}

.timeline-content:hover { border-color: rgba(0,212,170,0.2); }

.timeline-date {
  font-size: 0.8rem; font-weight: 600;
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
}

.timeline-content h3 {
  font-size: 1.15rem; font-weight: 700;
  margin: 6px 0 4px;
}

.timeline-company {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.timeline-company a {
  color: var(--accent);
  text-decoration: none;
}

.timeline-company a:hover { text-decoration: underline; }

.about-text a {
  color: var(--accent);
  text-decoration: none;
}

.about-text a:hover { text-decoration: underline; }

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 40px;
  align-items: start;
}

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

.info-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition);
}

.info-card:hover { border-color: rgba(0,212,170,0.2); }

.info-icon {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,212,170,0.1);
  border-radius: 10px;
  color: var(--accent);
  flex-shrink: 0;
}

.info-card h4 {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
}

.info-card p,
.info-card a {
  font-size: 0.88rem;
  color: var(--text-muted);
  text-decoration: none;
  line-height: 1.5;
}

.info-card a:hover { color: var(--accent); }

.contact-social {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.btn-sm {
  padding: 10px 18px !important;
  font-size: 0.85rem !important;
}

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

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

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

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

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

.form-group input,
.form-group textarea {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.95rem;
  color: var(--text);
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
  resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder { color: rgba(139,139,158,0.6); }

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: rgba(0,212,170,0.4);
  box-shadow: 0 0 0 3px rgba(0,212,170,0.1);
}

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

.btn-full { width: 100%; justify-content: center; }

.hp-field {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  width: 0;
  overflow: hidden;
}

.form-status {
  text-align: center;
  font-size: 0.9rem;
  min-height: 1.4em;
  transition: color var(--transition);
}

.form-status.success { color: var(--accent); }
.form-status.error { color: #f87171; }

.btn-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.spinner {
  animation: spin 0.8s linear infinite;
}

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

/* Legacy contact card (removed but keep glow util) */
.contact-card {
  position: relative;
  text-align: center;
  padding: 64px 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.contact-glow {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(124,58,237,0.1) 0%, transparent 70%);
  pointer-events: none;
}

.contact-card h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  font-weight: 800;
  margin-bottom: 16px;
  position: relative;
}

.contact-card > p {
  color: var(--text-muted);
  max-width: 500px;
  margin: 0 auto 32px;
  position: relative;
}

.contact-actions {
  display: flex; gap: 16px;
  justify-content: center; flex-wrap: wrap;
  position: relative;
}

/* Footer */
.footer {
  padding: 32px 0;
  border-top: 1px solid var(--border);
  position: relative; z-index: 1;
}

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

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

.footer a { color: var(--accent); text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* Reveal animations */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .project-card.featured {
    grid-template-columns: 1fr;
  }
  .project-card.featured .project-cta {
    grid-column: 1; grid-row: auto;
  }
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  .nav-links {
    position: fixed;
    top: var(--nav-h); left: 0; right: 0;
    flex-direction: column;
    background: rgba(10,10,15,0.98);
    padding: 24px;
    gap: 20px;
    border-bottom: 1px solid var(--border);
    transform: translateY(-120%);
    transition: transform var(--transition);
  }

  .nav-links.open { transform: translateY(0); }

  .hero-stats { flex-wrap: wrap; gap: 20px; }
  .stat-divider { display: none; }
  .projects-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; text-align: center; }
}
