/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* ===== THEME ===== */
:root {
  --bg: #07101f;
  --bg-elev: #0f1c33;
  --bg-card: rgba(255, 255, 255, 0.035);
  --border: rgba(165, 200, 240, 0.12);
  --text: #e6eef8;
  --text-dim: #8ea2bd;
  --accent: #7dd3fc;
  --accent-2: #818cf8;
  --accent-3: #6ee7b7;
  --gradient: linear-gradient(135deg, #7dd3fc 0%, #818cf8 55%, #6ee7b7 100%);
}

[data-theme="light"] {
  --bg: #eef4fa;
  --bg-elev: #ffffff;
  --bg-card: rgba(0, 0, 0, 0.025);
  --border: rgba(30, 60, 110, 0.12);
  --text: #0c1a2e;
  --text-dim: #4b5d74;
  --accent: #0284c7;
  --accent-2: #4338ca;
  --accent-3: #0f766e;
}

body {
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  line-height: 1.6;
  transition: background 0.4s ease, color 0.4s ease;
}

/* ===== BACKGROUND CANVAS ===== */
#bg-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.6;
}

/* ===== CURSOR GLOW ===== */
.cursor-glow {
  position: fixed;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(125, 211, 252, 0.18), transparent 70%);
  pointer-events: none;
  z-index: -1;
  transition: transform 0.2s ease;
  transform: translate(-50%, -50%);
}

/* ===== NAV ===== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  padding: 1.5rem 4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(7, 16, 31, 0.72);
  border-bottom: 1px solid var(--border);
}
[data-theme="light"] .nav { background: rgba(238, 244, 250, 0.8); }

.nav-logo {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.nav-logo .dot { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}
.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
  position: relative;
}
.nav-links a:hover { color: var(--text); }
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient);
  transition: width 0.3s;
}
.nav-links a:hover::after { width: 100%; }

#theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.2s;
}
#theme-toggle:hover { background: var(--bg-card); transform: rotate(180deg); }

/* ===== HERO ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4rem;
  padding: 6rem 4rem 2rem;
  position: relative;
}
.hero-content { max-width: 800px; text-align: left; width: 100%; }

.hero-portrait {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.portrait-ring {
  position: relative;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  padding: 4px;
  background: var(--gradient);
  background-size: 300% 300%;
  animation: gradientShift 8s ease infinite;
  box-shadow: 0 20px 60px rgba(125, 211, 252, 0.35);
}
.portrait-ring::before {
  content: '';
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  background: var(--gradient);
  filter: blur(30px);
  opacity: 0.4;
  z-index: -1;
  animation: gradientShift 8s ease infinite;
}
.portrait-ring img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: var(--bg-elev);
}
.portrait-fallback {
  display: none;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--bg-elev);
  color: var(--text);
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  font-weight: 700;
  letter-spacing: -0.05em;
  font-family: 'Space Grotesk', sans-serif;
}
.portrait-ring.no-img .portrait-fallback { display: flex; }

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 2rem;
  background: var(--bg-card);
}
.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7); }
  70% { box-shadow: 0 0 0 15px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

.hero-title {
  font-family: 'Archivo Black', 'Arial Black', sans-serif;
  font-size: clamp(2.5rem, 7vw, 5.5rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.01em;
  margin-bottom: 2rem;
}
.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 200% 200%;
  animation: gradientShift 8s ease infinite;
}
@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.outline-text {
  color: var(--text);
}

.hero-subtitle {
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  color: var(--text-dim);
  margin-bottom: 1rem;
  font-family: 'JetBrains Mono', monospace;
}
.typing::after {
  content: '|';
  animation: blink 1s infinite;
  color: var(--accent);
  margin-left: 0.1em;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-desc {
  font-size: 1.1rem;
  color: var(--text-dim);
  max-width: 500px;
  margin-bottom: 3rem;
}

.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; }
.btn {
  padding: 0.9rem 1.8rem;
  border-radius: 100px;
  font-weight: 500;
  text-decoration: none;
  font-size: 0.95rem;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.btn-primary {
  background: var(--gradient);
  color: white;
  box-shadow: 0 10px 30px rgba(125, 211, 252, 0.3);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 15px 40px rgba(125, 211, 252, 0.5); }
.btn-primary span { transition: transform 0.3s; }
.btn-primary:hover span { transform: translateX(4px); }

.btn-secondary {
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--bg-card);
}
.btn-secondary:hover { border-color: var(--accent); background: rgba(125, 211, 252, 0.12); }

.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-dim);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(var(--accent), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}
@keyframes scrollPulse {
  0%, 100% { transform: scaleY(0.3); opacity: 0.3; }
  50% { transform: scaleY(1); opacity: 1; }
}

/* ===== SECTIONS ===== */
.section {
  padding: 8rem 4rem;
  max-width: 1300px;
  margin: 0 auto;
}
.section-header {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  margin-bottom: 4rem;
}
.section-number {
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent);
  font-size: 1rem;
  letter-spacing: 0.1em;
}
.section-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

/* ===== ABOUT ===== */
.about-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 4rem;
}
.about-text .lead {
  font-size: 1.4rem;
  color: var(--text);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}
.about-text p {
  color: var(--text-dim);
  margin-bottom: 1.2rem;
  font-size: 1.05rem;
}
.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-content: start;
}
.stat-card {
  padding: 1.8rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-card);
  transition: all 0.3s;
}
.stat-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  background: rgba(125, 211, 252, 0.06);
}
.stat-num {
  font-size: 2.5rem;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat-label {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-top: 0.3rem;
}

/* ===== TIMELINE ===== */
.timeline {
  position: relative;
  padding-left: 2rem;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(var(--accent), transparent);
}
.timeline-item {
  position: relative;
  padding-bottom: 3rem;
}
.timeline-dot {
  position: absolute;
  left: -2.4rem;
  top: 0.5rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--bg), 0 0 20px var(--accent);
}
.timeline-date {
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  letter-spacing: 0.05em;
}
.timeline-card {
  padding: 2rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-card);
  transition: all 0.3s;
}
.timeline-card:hover {
  border-color: var(--accent);
  transform: translateX(8px);
}
.timeline-card h3 {
  font-size: 1.4rem;
  margin-bottom: 0.3rem;
}
.timeline-company {
  color: var(--accent-2);
  font-size: 0.95rem;
  margin-bottom: 1rem;
  font-weight: 500;
}
.timeline-card p {
  color: var(--text-dim);
  margin-bottom: 1rem;
}

.tags { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.tag {
  padding: 0.3rem 0.8rem;
  border-radius: 100px;
  background: rgba(125, 211, 252, 0.12);
  border: 1px solid rgba(125, 211, 252, 0.3);
  color: var(--accent);
  font-size: 0.8rem;
  font-family: 'JetBrains Mono', monospace;
}

/* ===== SKILLS ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}
.skill-category {
  padding: 2rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-card);
  transition: all 0.3s;
}
.skill-category:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
}
.skill-category h3 {
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
}
.skill {
  margin-bottom: 1rem;
}
.skill span {
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  display: block;
  color: var(--text-dim);
}
.bar {
  height: 6px;
  background: var(--bg-elev);
  border-radius: 100px;
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--gradient);
  border-radius: 100px;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.skill.in-view .bar i { width: 100%; }

/* ===== PROJECTS ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}
.project-card {
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  background: var(--bg-card);
  transition: all 0.3s;
}
.project-card:hover {
  transform: translateY(-8px);
  border-color: var(--accent);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.project-visual {
  height: 200px;
  background: var(--grad);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.project-visual::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.2), transparent);
}
.project-emoji { font-size: 4rem; filter: drop-shadow(0 4px 20px rgba(0,0,0,0.3)); position: relative; z-index: 2; }

.project-image {
  background: var(--img) center/cover no-repeat;
  transition: transform 0.6s ease;
}
.project-image::before,
.project-image::after { display: none; }
.project-card:hover .project-image {
  transform: scale(1.08);
}
.project-info { padding: 1.8rem; }
.project-info h3 { font-size: 1.4rem; margin-bottom: 0.8rem; }
.project-info p { color: var(--text-dim); margin-bottom: 1rem; font-size: 0.95rem; }
.project-link {
  display: inline-block;
  margin-top: 1rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: gap 0.3s;
}
.project-link:hover { color: var(--accent-2); }

/* ===== CONTACT ===== */
.contact-section { text-align: center; }
.contact-section .section-header { justify-content: center; }
.contact-wrap { max-width: 700px; margin: 0 auto; }
.contact-lead {
  font-size: 1.3rem;
  color: var(--text-dim);
  margin-bottom: 3rem;
  line-height: 1.5;
}
.contact-email {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 200% 200%;
  animation: gradientShift 8s ease infinite;
  transition: transform 0.3s;
  margin-bottom: 2rem;
}
.contact-email:hover { transform: scale(1.05); }
.contact-email .arrow { -webkit-text-fill-color: var(--accent); font-size: 0.7em; }

.socials {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}
.social {
  padding: 0.8rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-dim);
  text-decoration: none;
  transition: all 0.2s;
  font-size: 0.9rem;
}
.social:hover {
  color: var(--text);
  border-color: var(--accent);
  background: rgba(125, 211, 252, 0.12);
}

/* ===== FOOTER ===== */
.footer {
  padding: 2rem 4rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

/* ===== REVEAL ANIM ===== */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== EXPERTISE ===== */
.expertise { margin-top: 4rem; }
.expertise-title {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--text);
}
.expertise-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.expertise-item {
  padding: 1rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.95rem;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.icon {
  width: 1.1em;
  height: 1.1em;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--accent);
}
h3 .icon {
  width: 1.2em;
  height: 1.2em;
  vertical-align: -0.15em;
  margin-right: 0.5rem;
}
.expertise-item:hover {
  border-color: var(--accent);
  background: rgba(125, 211, 252, 0.10);
  transform: translateY(-2px);
}

.signature {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

/* ===== PROJECT META ===== */
.project-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
  letter-spacing: 0.05em;
}

/* ===== CLIENT MARQUEE ===== */
.clients {
  margin-top: 5rem;
  padding-top: 3rem;
  border-top: 1px solid var(--border);
}
.clients-title {
  text-align: center;
  font-size: 1.3rem;
  margin-bottom: 2rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.client-group {
  margin-bottom: 2rem;
  padding: 1.5rem 1.8rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  background: var(--bg-card);
  transition: all 0.3s;
}
.client-group:hover {
  border-left-color: var(--accent-2);
  transform: translateX(4px);
}
.client-period {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  color: var(--accent);
  margin-bottom: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.client-para {
  color: var(--text);
  font-size: 1rem;
  line-height: 1.7;
}

/* ===== EDUCATION ===== */
.edu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}
.edu-heading {
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--border);
}
.edu-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.edu-list.compact { gap: 0.8rem; }
.edu-item {
  padding: 1rem 1.2rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background: var(--bg-card);
  transition: all 0.3s;
}
.edu-item:hover {
  transform: translateX(6px);
  border-left-color: var(--accent-2);
}
.edu-year {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 0.3rem;
  letter-spacing: 0.05em;
}
.edu-title {
  font-weight: 600;
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 0.2rem;
}
.edu-place {
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.4;
}
.edu-list.compact .edu-item { padding: 0.7rem 1rem; }
.edu-list.compact .edu-title { font-size: 0.95rem; font-weight: 500; }

/* ===== CONTACT META ===== */
.contact-meta {
  display: flex;
  justify-content: center;
  gap: 1rem;
  color: var(--text-dim);
  font-size: 0.95rem;
  margin-top: 1rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .nav { padding: 1rem 1.5rem; }
  .nav-links { display: none; }
  .hero, .section { padding-left: 1.5rem; padding-right: 1.5rem; }
  .hero { flex-direction: column-reverse; gap: 2rem; }
  .portrait-ring { width: 150px; height: 150px; }
  .section { padding-top: 5rem; padding-bottom: 5rem; }
  .about-grid { grid-template-columns: 1fr; gap: 2rem; }
  .edu-grid { grid-template-columns: 1fr; gap: 2rem; }
  .hero-title { font-size: clamp(2.2rem, 10vw, 3.5rem); }
  .marquee-track span { font-size: 1.1rem; }
}
