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

:root {
  --bg: #0a0a0f;
  --bg-card: #111118;
  --bg-card-hover: #18181f;
  --border: #1e1e2a;
  --border-hover: #2a2a3a;
  --text: #e0e0e6;
  --text-muted: #8888a0;
  --text-dim: #55556a;
  --accent: #7b5ea7;
  --accent-light: #a78bfa;
  --accent-glow: rgba(123, 94, 167, 0.15);
  --font: 'Poppins', system-ui, -apple-system, sans-serif;
  --radius: 12px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  -webkit-text-size-adjust: 100%;
}

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

::selection {
  background: var(--accent);
  color: #fff;
}

/* Star field canvas */
#starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

main, nav, footer, .back-to-top {
  position: relative;
  z-index: 1;
}

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

img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ===== LAYOUT ===== */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 100px 0;
}

@media (max-width: 768px) {
  .section { padding: 70px 0; }
  .container { padding: 0 20px; }
}

/* ===== NAVBAR ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), background var(--transition);
}

.navbar.scrolled {
  border-bottom-color: var(--border);
  background: rgba(10, 10, 15, 0.95);
}

.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.nav-brand {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  transition: color var(--transition);
}
.nav-brand:hover {
  color: var(--accent-light);
}

.nav-menu {
  list-style: none;
  display: flex;
  gap: 8px;
}

.nav-link {
  display: block;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 8px;
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.nav-link.active {
  color: var(--accent-light);
}

/* Hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: background var(--transition);
}
.nav-toggle:hover {
  background: rgba(255, 255, 255, 0.05);
}

.hamburger-line {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle.open .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle.open .hamburger-line:nth-child(2) {
  opacity: 0;
}
.nav-toggle.open .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }
  .nav-menu {
    display: none;
    position: absolute;
    top: 70px;
    left: 16px;
    right: 16px;
    flex-direction: column;
    background: #111118;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    gap: 2px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  }
  .nav-menu.open {
    display: flex;
  }
  .nav-link {
    padding: 12px 16px;
    font-size: 0.9rem;
  }
}

/* ===== HERO ===== */
.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 70px;
}

.hero-content {
  max-width: 700px;
}

.hero-greeting {
  display: block;
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.hero-name {
  display: block;
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.hero-title {
  margin-bottom: 0;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.5;
}

.gradient-text {
  background: linear-gradient(135deg, #fff 0%, var(--accent-light) 50%, #fff 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 6s ease-in-out infinite;
}

@keyframes gradient-shift {
  0%, 100% { background-position: 0% center; }
  50% { background-position: 100% center; }
}

/* ===== SECTION HEADINGS ===== */
.section-heading {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  margin-bottom: 48px;
  line-height: 1.2;
}

.accent {
  color: var(--accent-light);
}

.section-intro {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 600px;
  margin-bottom: 48px;
  line-height: 1.8;
}

/* ===== EXPERTISE ===== */
.expertise-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 60px;
}

.expertise-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 28px;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.expertise-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.expertise-icon {
  color: var(--accent-light);
  margin-bottom: 20px;
}

.expertise-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 12px;
  line-height: 1.4;
}

.expertise-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.7;
}

@media (max-width: 768px) {
  .expertise-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* Quote */
.quote-block {
  border-left: 3px solid var(--accent);
  padding: 24px 32px;
  margin: 0;
  background: var(--bg-card);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.quote-block p {
  font-size: 1.05rem;
  font-style: italic;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.7;
}

.quote-block cite {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-style: normal;
}

/* ===== WORK / PROJECTS ===== */
.featured-project {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 40px;
  transition: border-color var(--transition);
}

.featured-project:hover {
  border-color: var(--border-hover);
}

.featured-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent-light);
  margin-bottom: 8px;
}

.featured-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.featured-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent-light);
  transition: gap var(--transition);
}
.featured-link:hover {
  gap: 12px;
}

/* Filter */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.filter-btn {
  background: none;
  border: none;
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-dim);
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 6px;
  transition: color var(--transition), background var(--transition);
}

.filter-btn:hover {
  color: var(--text);
}

.filter-btn.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.filter-count {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-left: 2px;
}

.filter-sep {
  color: var(--text-dim);
  font-size: 0.85rem;
  user-select: none;
}

/* Project cards */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.project-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
}

.project-card.hidden {
  display: none;
}

.project-image-link {
  display: block;
  overflow: hidden;
}

.project-image {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #0d0d14;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card:hover .project-image img {
  transform: scale(1.05);
}

.project-info {
  padding: 20px 24px 24px;
}

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

.project-category {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 10px;
  font-weight: 500;
}

.project-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 14px;
}

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

.tag {
  display: inline-block;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 500;
  background: rgba(123, 94, 167, 0.12);
  color: var(--accent-light);
  border-radius: 4px;
  letter-spacing: 0.02em;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent-light);
  transition: gap var(--transition);
}
.project-link:hover {
  gap: 10px;
}

@media (max-width: 768px) {
  .projects-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* ===== EXPERIENCE TIMELINE ===== */
.timeline {
  position: relative;
  padding-left: 36px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: linear-gradient(to bottom, var(--border), var(--accent), var(--border));
}

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

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

.timeline-marker {
  position: absolute;
  left: -33px;
  top: 8px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  transition: background var(--transition);
}

.timeline-item:hover .timeline-marker {
  background: var(--accent);
}

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

.timeline-item:hover .timeline-content {
  border-color: var(--border-hover);
}

.timeline-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.timeline-role {
  font-size: 1.05rem;
  font-weight: 600;
}

.timeline-at {
  font-weight: 400;
  color: var(--accent-light);
}

.timeline-date {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-dim);
  white-space: nowrap;
}

.timeline-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 16px;
}

.timeline-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

@media (max-width: 768px) {
  .timeline {
    padding-left: 28px;
  }
  .timeline-marker {
    left: -25px;
    width: 13px;
    height: 13px;
  }
  .timeline::before {
    left: 5px;
  }
}

/* ===== CONTACT ===== */
.contact-availability {
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 600;
  margin-bottom: 16px;
  line-height: 1.3;
}

.contact-intro {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.8;
}

.contact-email {
  display: inline-block;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--accent-light);
  margin-bottom: 28px;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition);
}
.contact-email:hover {
  border-bottom-color: var(--accent-light);
}

.contact-socials {
  display: flex;
  gap: 16px;
  margin-bottom: 60px;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: color var(--transition), border-color var(--transition), transform var(--transition);
}

.social-link:hover {
  color: var(--accent-light);
  border-color: var(--accent);
  transform: translateY(-3px);
}

/* Contact Form */
.contact-form-wrapper {
  max-width: 600px;
  margin-bottom: 80px;
}

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

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

@media (max-width: 500px) {
  .form-row { grid-template-columns: 1fr; }
}

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

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

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 12px 16px;
  font-family: var(--font);
  font-size: 0.9rem;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  resize: none;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: var(--text-dim);
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-submit {
  align-self: flex-start;
  padding: 12px 32px;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}

.form-submit:hover {
  background: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(123, 94, 167, 0.3);
}

.form-submit:active {
  transform: translateY(0);
}

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

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

.testimonial:hover {
  border-color: var(--border-hover);
}

.testimonial-text {
  font-size: 0.88rem;
  font-style: italic;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 16px;
}

.testimonial-author strong {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

@media (max-width: 768px) {
  .testimonials {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* ===== FOOTER ===== */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
}

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

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

.footer-rights {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.footer-socials {
  display: flex;
  gap: 12px;
}

.footer-socials a {
  color: var(--text-dim);
  transition: color var(--transition), transform var(--transition);
}
.footer-socials a:hover {
  color: var(--accent-light);
  transform: translateY(-2px);
}

@media (max-width: 768px) {
  .footer-content {
    flex-direction: column;
    text-align: center;
  }
}

/* ===== BACK TO TOP ===== */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: all var(--transition);
  z-index: 50;
}

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

.back-to-top:hover {
  color: var(--accent-light);
  border-color: var(--accent);
  transform: translateY(-3px);
}

/* ===== SCROLL REVEAL ===== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Stagger children */
.expertise-card.reveal:nth-child(2) { transition-delay: 0.1s; }
.expertise-card.reveal:nth-child(3) { transition-delay: 0.2s; }

.project-card.reveal:nth-child(2) { transition-delay: 0.05s; }
.project-card.reveal:nth-child(3) { transition-delay: 0.1s; }
.project-card.reveal:nth-child(4) { transition-delay: 0.15s; }
.project-card.reveal:nth-child(5) { transition-delay: 0.2s; }
.project-card.reveal:nth-child(6) { transition-delay: 0.25s; }

.timeline-item.reveal:nth-child(2) { transition-delay: 0.1s; }
.timeline-item.reveal:nth-child(3) { transition-delay: 0.2s; }

.testimonial.reveal:nth-child(2) { transition-delay: 0.1s; }
.testimonial.reveal:nth-child(3) { transition-delay: 0.2s; }

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .reveal {
    opacity: 1;
    transform: none;
  }
  .gradient-text { animation: none; }
}
