/* ============================================================
   style.css — jexlab.tech Portfolio
   Dark theme with blue accent
   ============================================================ */

/* ---------------------------------------------------------
   CSS Variables & Reset
   --------------------------------------------------------- */
:root {
  --bg-primary: #0a0f1a;
  --bg-secondary: #111827;
  --bg-card: #1a2332;
  --bg-hover: #1f2a3e;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #64b4ff;
  --accent-dim: #3b82f6;
  --accent-glow: rgba(100, 180, 255, 0.15);
  --border: #1e293b;
  --nav-height: 60px;
  --max-width: 1100px;
  --radius: 12px;
  --radius-sm: 8px;
}

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

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

section[id] {
  scroll-margin-top: var(--nav-height);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  color: #93c9ff;
}

/* ---------------------------------------------------------
   Particles Canvas (background)
   --------------------------------------------------------- */
#particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

/* All content sits above the canvas */
#navbar, section, footer {
  position: relative;
  z-index: 1;
}

/* ---------------------------------------------------------
   Navigation
   --------------------------------------------------------- */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  background: transparent;
  transition: background 0.3s, backdrop-filter 0.3s, box-shadow 0.3s;
  z-index: 100;
}

#navbar.nav-scrolled {
  background: rgba(10, 15, 26, 0.92);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  width: 100%;
  max-width: var(--max-width);
  padding: 0 24px;
}

.nav-logo {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent) !important;
  letter-spacing: -1px;
}

.nav-links {
  display: flex;
  gap: 20px;
  flex: 1;
  justify-content: center;
}

#navbar a {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  padding: 8px 4px;
  transition: color 0.2s;
  position: relative;
}

#navbar a span {
  color: var(--accent);
  font-size: 0.7rem;
  margin-right: 3px;
  font-weight: 600;
}

#navbar a:hover,
#navbar a.active {
  color: var(--text-primary);
}

/* ---------------------------------------------------------
   Section Layout
   --------------------------------------------------------- */
section {
  padding: 100px 24px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 48px;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

/* ---------------------------------------------------------
   Hero Section
   --------------------------------------------------------- */
#hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: calc(var(--nav-height) + 40px);
}

.hero-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 500px;
  height: 500px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(100, 180, 255, 0.06) 0%, rgba(59, 130, 246, 0.03) 40%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  animation: glow-pulse 6s ease-in-out infinite;
  z-index: -1;
}

@keyframes glow-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; }
  50% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
}

.hero-content {
  position: relative;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

.hero-greeting {
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.hero-name {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: 8px;
}

.hero-tagline {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.typewriter-cursor {
  color: var(--accent);
  font-weight: 300;
  animation: none;
}

.hero-desc {
  max-width: 540px;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 32px;
}

.hero-stats {
  display: flex;
  gap: 40px;
}

.stat {
  text-align: left;
}

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

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

/* ---------------------------------------------------------
   Hero Inner Layout (text + dino side by side)
   --------------------------------------------------------- */
#hero .hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

#hero .hero-content {
  flex: 1;
  min-width: 0;
  max-width: 580px;
}

/* ---------------------------------------------------------
   Running Dinosaur with Laptop
   --------------------------------------------------------- */
.hero-dino {
  flex-shrink: 0;
  width: 420px;
  height: 340px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dino-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* ---- BODY BOB (running bounce) ---- */
.dino-body,
.dino-head-group,
.dino-tail,
.dino-belly,
.dino-details {
  animation: dino-bob 0.5s ease-in-out infinite;
}

@keyframes dino-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ---- LEGS (running cycle) ---- */
.leg-front {
  animation: leg-front-cycle 0.5s ease-in-out infinite;
  transform-origin: 245px 205px;
}

.leg-back {
  animation: leg-back-cycle 0.5s ease-in-out infinite;
  transform-origin: 195px 200px;
}

@keyframes leg-front-cycle {
  0%, 100% { transform: rotate(-8deg) translateY(0); }
  50% { transform: rotate(10deg) translateY(-3px); }
}

@keyframes leg-back-cycle {
  0%, 100% { transform: rotate(8deg) translateY(0); }
  50% { transform: rotate(-10deg) translateY(-3px); }
}

/* ---- TAIL SWISH ---- */
.dino-tail {
  animation: tail-swish 0.5s ease-in-out infinite;
  transform-origin: 185px 175px;
}

@keyframes tail-swish {
  0%, 100% { transform: rotate(-2deg); }
  50% { transform: rotate(5deg); }
}

/* ---- HEAD BOB (slight extra) ---- */
.dino-head-group {
  animation: head-bob 0.5s ease-in-out infinite;
  transform-origin: 310px 80px;
}

@keyframes head-bob {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-4px) rotate(2deg); }
}

/* ---- ARMS ---- */
.dino-arms {
  animation: arms-bounce 0.5s ease-in-out infinite;
  transform-origin: 290px 145px;
}

@keyframes arms-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

/* ---- LAPTOP ---- */
.dino-laptop {
  animation: laptop-bob 0.5s ease-in-out infinite;
}

@keyframes laptop-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* Screen glow pulse */
.laptop-screen-glow {
  animation: screen-pulse 2s ease-in-out infinite;
}

@keyframes screen-pulse {
  0%, 100% { opacity: 0.08; }
  50% { opacity: 0.18; }
}

/* Code line typing effect */
.code-line {
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  animation: type-code 3s ease-in-out infinite;
}

.code-line.c1 { animation-delay: 0s; }
.code-line.c2 { animation-delay: 0.4s; }
.code-line.c3 { animation-delay: 0.8s; }

@keyframes type-code {
  0% { stroke-dashoffset: 60; opacity: 0; }
  20% { stroke-dashoffset: 0; opacity: 0.7; }
  80% { stroke-dashoffset: 0; opacity: 0.7; }
  100% { stroke-dashoffset: -60; opacity: 0; }
}

/* ---- SPEED LINES ---- */
.speed-lines line {
  animation: speed-line 1.2s linear infinite;
}

.speed-lines line:nth-child(1) { animation-delay: 0s; }
.speed-lines line:nth-child(2) { animation-delay: 0.3s; }
.speed-lines line:nth-child(3) { animation-delay: 0.6s; }
.speed-lines line:nth-child(4) { animation-delay: 0.9s; }

@keyframes speed-line {
  0% { transform: translateX(0); opacity: 0; }
  30% { opacity: var(--speed-opacity, 0.4); }
  100% { transform: translateX(-30px); opacity: 0; }
}

.speed-lines line:nth-child(1) { --speed-opacity: 0.4; }
.speed-lines line:nth-child(2) { --speed-opacity: 0.25; }
.speed-lines line:nth-child(3) { --speed-opacity: 0.15; }
.speed-lines line:nth-child(4) { --speed-opacity: 0.2; }

/* ---- DUST PARTICLES ---- */
.dust-particles circle {
  animation: dust-float 1.5s ease-out infinite;
}

.dust-particles circle:nth-child(1) { animation-delay: 0s; }
.dust-particles circle:nth-child(2) { animation-delay: 0.4s; }
.dust-particles circle:nth-child(3) { animation-delay: 0.8s; }
.dust-particles circle:nth-child(4) { animation-delay: 1.2s; }

@keyframes dust-float {
  0% { transform: translate(0, 0) scale(1); opacity: 0.3; }
  50% { transform: translate(-15px, -10px) scale(1.2); opacity: 0.2; }
  100% { transform: translate(-30px, -20px) scale(0.5); opacity: 0; }
}

/* ---- SHADOW PULSE ---- */
.dino-shadow {
  animation: shadow-pulse 0.5s ease-in-out infinite;
}

@keyframes shadow-pulse {
  0%, 100% { opacity: 0.06; transform: scaleX(1); }
  50% { opacity: 0.1; transform: scaleX(1.08); }
}

/* ---- LAPTOP GLOW REFLECTION ---- */
.laptop-glow-under {
  animation: glow-under 2s ease-in-out infinite;
}

@keyframes glow-under {
  0%, 100% { opacity: 0.04; }
  50% { opacity: 0.1; }
}

.about-text {
  max-width: 650px;
}

.about-text p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.8;
}

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

/* ---------------------------------------------------------
   Experience Section (Timeline)
   --------------------------------------------------------- */
#experience {
  padding-top: 100px;
}

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

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

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

.timeline-item::before {
  content: '';
  position: absolute;
  left: -24px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg-primary);
  box-shadow: 0 0 0 2px var(--accent-dim);
}

.timeline-date {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 4px;
}

.timeline-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

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

.timeline-desc ul {
  list-style: none;
  padding: 0;
}

.timeline-desc li {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.7;
  padding-left: 16px;
  position: relative;
  margin-bottom: 4px;
}

.timeline-desc li::before {
  content: '\25B9';
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* ---------------------------------------------------------
   Skills Section
   --------------------------------------------------------- */
#skills {
  padding-top: 100px;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

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

.skill-group-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.skill-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: var(--bg-hover);
  padding: 6px 12px;
  border-radius: 20px;
  position: relative;
  overflow: hidden;
  transition: background 0.2s, color 0.2s, transform 0.2s, box-shadow 0.2s;
}

/* Shine-sweep effect */
.skill-badge::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
  transform: skewX(-20deg);
  transition: left 0.5s ease;
}

.skill-badge:hover {
  background: var(--accent-glow);
  color: var(--accent);
  transform: translateY(-4px) scale(1.05);
  border-color: var(--accent);
  box-shadow: 0 6px 25px rgba(100, 180, 255, 0.2);
  animation: badge-float 1.5s ease-in-out infinite;
}

.skill-badge:hover::after {
  left: 130%;
}

@keyframes badge-float {
  0%, 100% { transform: translateY(-4px) scale(1.05); }
  50% { transform: translateY(-8px) scale(1.05); }
}

.skill-badge .icon {
  font-size: 0.9rem;
}

/* ---------------------------------------------------------
   Projects Section
   --------------------------------------------------------- */
#projects {
  padding-top: 100px;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  perspective: 1000px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: border-color 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  transform-style: preserve-3d;
}

.project-card:hover {
  border-color: var(--accent-dim);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.folder-icon {
  font-size: 1.8rem;
  margin-bottom: 12px;
}

.project-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}

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

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

.project-card .tech span {
  font-size: 0.7rem;
  color: var(--accent);
  font-weight: 500;
  letter-spacing: 0.5px;
}

.project-card .links a {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s;
}

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

/* ---------------------------------------------------------
   Education Section
   --------------------------------------------------------- */
#education {
  padding-top: 100px;
}

.edu-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.edu-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  position: relative;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  overflow: hidden;
}

.edu-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--accent), var(--accent-dim));
  border-radius: 0 2px 2px 0;
}

.edu-card:hover {
  border-color: var(--accent-dim);
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.edu-year {
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  display: inline-block;
  background: var(--accent-glow);
  padding: 3px 10px;
  border-radius: 4px;
}

.edu-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.4;
}

.edu-school {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 4px;
}

.edu-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ---------------------------------------------------------
   Contact Section
   --------------------------------------------------------- */
#contact {
  padding-top: 100px;
  text-align: center;
}

.contact-intro {
  max-width: 520px;
  margin: 0 auto 40px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.8;
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.contact-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 28px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary) !important;
  transition: border-color 0.2s, transform 0.2s, background 0.2s;
}

.contact-card:hover {
  border-color: var(--accent-dim);
  background: var(--bg-hover);
  transform: translateY(-3px);
}

.contact-icon {
  font-size: 1.3rem;
}

.contact-label {
  font-weight: 600;
  color: var(--text-secondary);
}

.contact-value {
  color: var(--accent);
}

/* ---------------------------------------------------------
   Footer
   --------------------------------------------------------- */
footer {
  text-align: center;
  padding: 40px 24px;
  border-top: 1px solid var(--border);
  max-width: var(--max-width);
  margin: 0 auto;
}

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

/* ---------------------------------------------------------
   Responsive Design
   --------------------------------------------------------- */
@media (max-width: 1024px) {
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .edu-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Dino gets smaller on tablet */
  .hero-dino {
    width: 320px;
    height: 260px;
  }

  #hero .hero-inner {
    gap: 24px;
  }
}

@media (max-width: 768px) {
  .nav-links {
    gap: 10px;
  }

  #navbar a span {
    display: inline;
  }

  section {
    padding: 80px 20px;
  }

  .section-title {
    font-size: 1.5rem;
    margin-bottom: 36px;
  }

  .hero-stats {
    gap: 24px;
  }

  /* Stack dino below text on mobile */
  #hero .hero-inner {
    flex-direction: column;
    gap: 32px;
  }

  #hero .hero-content {
    max-width: 100%;
    text-align: center;
  }

  #hero .hero-stats {
    justify-content: center;
  }

  .hero-desc {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-dino {
    width: 300px;
    height: 240px;
  }

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

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

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

  .contact-links {
    flex-direction: column;
    align-items: center;
  }

  .nav-inner {
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .nav-links a:not(.active) {
    display: none;
  }
  .nav-links a.active {
    display: block;
  }

  .edu-card {
    padding: 20px;
  }
}
