/* ── Reset & Base ── */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0a0a0a;
  --bg2: #111111;
  --bg3: #1a1a1a;
  --text: #f0f0f0;
  --text-muted: #888888;
  --accent1: #ff6b35;
  --accent2: #7c3aed;
  --accent3: #06d6a0;
  --accent4: #ffd166;
  --border: #2a2a2a;
  --card: #141414;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

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

/* ── Particle canvas ── */
#particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* ── Navigation ── */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 60px;
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-size: 1.3rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  gap: 40px;
  list-style: none;
}

.nav-links a {
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: color 0.2s;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

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

/* ── Hero ── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 0 60px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -200px;
  right: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -100px;
  left: -100px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255, 107, 53, 0.1) 0%, transparent 70%);
  pointer-events: none;
}

.hero-tag {
  display: inline-block;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent3);
  margin-bottom: 20px;
  padding: 6px 16px;
  border: 1px solid rgba(6, 214, 160, 0.3);
  border-radius: 100px;
  width: fit-content;
}

.hero-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 16px;
  min-height: 1.5rem;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 24px;
  max-width: 800px;
  background: linear-gradient(135deg, var(--accent1) 0%, var(--accent2) 50%, var(--accent3) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: glow-pulse 3s ease-in-out infinite;
  min-height: 6rem;
}

.hero-title .cursor {
  -webkit-text-fill-color: var(--accent1);
}

/* ── Blinking cursor ── */
.cursor {
  animation: blink 1s infinite;
  font-weight: 300;
  -webkit-text-fill-color: var(--accent1);
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ── Glow pulse ── */
@keyframes glow-pulse {
  0%, 100% {
    filter: drop-shadow(0 0 8px rgba(255, 107, 53, 0.4));
  }
  50% {
    filter: drop-shadow(0 0 24px rgba(124, 58, 237, 0.7));
  }
}

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

.hero-btns {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn-primary {
  padding: 14px 32px;
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  color: white;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: opacity 0.2s, transform 0.2s;
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

.btn-secondary {
  padding: 14px 32px;
  background: transparent;
  color: var(--text);
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid var(--border);
  transition: border-color 0.2s, transform 0.2s;
  cursor: pointer;
}

.btn-secondary:hover {
  border-color: var(--accent1);
  transform: translateY(-2px);
}

/* ── Section ── */
section {
  padding: 100px 60px;
}

.section-label {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent1);
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.2;
}

.section-sub {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 560px;
  margin-bottom: 60px;
}

/* ── Skills Grid ── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.skill-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.skill-card:hover {
  border-color: var(--accent2);
  transform: translateY(-4px);
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.15);
}

.skill-card-icon {
  font-size: 1.8rem;
  margin-bottom: 14px;
}

.skill-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text);
}

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

/* ── Project Cards ── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.project-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  border-color: var(--accent1);
  transform: translateY(-6px);
  box-shadow: 0 0 24px rgba(255, 107, 53, 0.15);
}

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

.project-number {
  font-size: 0.75rem;
  color: var(--accent1);
  font-weight: 700;
  letter-spacing: 0.1em;
}

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

.tag {
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 100px;
  font-weight: 500;
  letter-spacing: 0.05em;
}

.tag-orange { background: rgba(255, 107, 53, 0.15); color: var(--accent1); }
.tag-purple { background: rgba(124, 58, 237, 0.15); color: #a78bfa; }
.tag-green  { background: rgba(6, 214, 160, 0.15);  color: var(--accent3); }
.tag-yellow { background: rgba(255, 209, 102, 0.15); color: var(--accent4); }

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

.project-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
  flex: 1;
  margin-bottom: 24px;
}

.project-metrics {
  display: flex;
  gap: 20px;
  margin-bottom: 24px;
  padding: 16px;
  background: var(--bg3);
  border-radius: 8px;
}

.metric {
  text-align: center;
}

.metric-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent3);
}

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

.project-links {
  display: flex;
  gap: 12px;
}

.project-link {
  flex: 1;
  text-align: center;
  padding: 10px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s;
}

.project-link.github {
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.project-link.github:hover {
  border-color: var(--accent1);
  color: var(--accent1);
}

.project-link.demo {
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  color: white;
}

.project-link.demo:hover {
  opacity: 0.85;
}

/* ── Stats Bar ── */
.stats-bar {
  display: flex;
  gap: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 80px;
}

.stat-item {
  flex: 1;
  padding: 32px;
  text-align: center;
  border-right: 1px solid var(--border);
}

.stat-item:last-child {
  border-right: none;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

/* ── Footer ── */
footer {
  padding: 40px 60px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

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

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

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

/* ── Page Header ── */
.page-header {
  padding: 160px 60px 80px;
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  margin-bottom: 16px;
}

.page-header p {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 500px;
}

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

.contact-info h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.contact-info p {
  color: var(--text-muted);
  margin-bottom: 32px;
  line-height: 1.8;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.contact-item-icon {
  width: 36px;
  height: 36px;
  background: var(--bg3);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  letter-spacing: 0.05em;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s;
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent2);
}

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

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

.about-text h2 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 20px;
}

.about-text p {
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.8;
}

.timeline {
  position: relative;
  padding-left: 24px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

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

.timeline-item::before {
  content: '';
  position: absolute;
  left: -28px;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent1);
}

.timeline-date {
  font-size: 0.78rem;
  color: var(--accent1);
  font-weight: 600;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}

.timeline-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.timeline-sub {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  nav { padding: 16px 24px; }
  .nav-links { gap: 20px; }
  .hero { padding: 0 24px; }
  section { padding: 60px 24px; }
  .contact-grid { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .stats-bar { flex-direction: column; }
  .stat-item { border-right: none; border-bottom: 1px solid var(--border); }
  footer { flex-direction: column; gap: 16px; text-align: center; }
  .page-header { padding: 120px 24px 60px; }
  .skills-progress { padding: 0; }
}

/* ── Back to top button ── */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  color: white;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s, transform 0.3s;
  z-index: 200;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Theme toggle button ── */
.theme-toggle {
  position: fixed;
  bottom: 32px;
  left: 32px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 200;
  transition: border-color 0.2s, transform 0.2s;
}

.theme-toggle:hover {
  border-color: var(--accent1);
  transform: scale(1.1);
}

/* ── Light mode ── */
body.light-mode {
  --bg: #ffffff;
  --bg2: #f8f8f8;
  --bg3: #f0f0f0;
  --text: #1a1a1a;
  --text-muted: #555555;
  --border: #dddddd;
  --card: #f5f5f5;
}

body.light-mode nav {
  background: rgba(255, 255, 255, 0.92);
}

/* ── Skills progress bars ── */
.skills-progress {
  margin-top: 48px;
  padding: 0 60px;
}

.progress-item {
  margin-bottom: 24px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  margin-bottom: 10px;
  color: var(--text);
  font-weight: 500;
}

.progress-label span:last-child {
  color: var(--accent1);
  font-size: 0.8rem;
}

.progress-bar {
  height: 8px;
  background: var(--bg3);
  border-radius: 100px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.progress-fill {
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  transition: width 1.2s ease;
}