@font-face {
  font-family: "Makcasa";
  src: url("./fonts/Makcasa-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ===== Design Tokens ===== */
:root {
  --bg: #f1eee7;
  --bg-alt: #f8f6f1;
  --bg-soft: #e9e5db;
  --text: #1c1a24;
  --text-muted: #6b6759;
  --primary: #4338ca;
  --primary-hover: #362ea8;
  --accent: #0891b2;
  --amber: #d97706;
  --border: rgba(28, 26, 36, 0.09);
  --shadow: 0 4px 24px rgba(28, 26, 36, 0.07);
  --shadow-lg: 0 24px 60px rgba(28, 26, 36, 0.14);
  --radius: 14px;
  --radius-lg: 24px;
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --font-display: "Space Grotesk", sans-serif;
  --font-brand: "Makcasa", "Space Grotesk", serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --header-h: 72px;
}

body.dark-mode {
  --bg: #1a1a2e;
  --bg-alt: #22223a;
  --bg-soft: #2a2a40;
  --text: #e7e5ef;
  --text-muted: #a8a5b8;
  --primary: #818cf8;
  --primary-hover: #a5b4fc;
  --accent: #22d3ee;
  --amber: #fbbf24;
  --border: rgba(231, 229, 239, 0.12);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.4);
}

/* ===== Reset & Base ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  transition: background 0.6s var(--ease), color 0.6s var(--ease);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  position: relative;
}
::selection {
  background: rgba(67, 56, 202, 0.25);
  color: var(--text);
}
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

::-webkit-scrollbar { width: 9px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
}

/* ===== Reveal System (shared, quiet) ===== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal.delay-1 { transition-delay: 0.08s; }
.reveal.delay-2 { transition-delay: 0.16s; }
.reveal.delay-3 { transition-delay: 0.24s; }
.reveal.delay-4 { transition-delay: 0.32s; }

/* Hero title lines */
.reveal-line {
  display: block;
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.hero-title.ready .reveal-line { opacity: 1; transform: translateY(0); }
.hero-title.ready .reveal-line:nth-child(1) { transition-delay: 0.1s; }
.hero-title.ready .reveal-line:nth-child(2) { transition-delay: 0.24s; }
.hero-title.ready .reveal-line:nth-child(3) { transition-delay: 0.38s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal, .reveal-line { opacity: 1 !important; transform: none !important; }
}

/* ===== Theme Toggle & Back to Top ===== */
.theme-toggle,
.back-to-top {
  position: fixed;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  z-index: 999;
  display: grid;
  place-items: center;
  transition: transform 0.35s var(--ease-spring), box-shadow 0.3s var(--ease), opacity 0.3s ease;
}
.theme-toggle {
  top: 100px;
  right: 22px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 8px 24px rgba(67, 56, 202, 0.3);
}
.theme-toggle:hover { transform: scale(1.08); }
.theme-toggle:active { transform: scale(0.94); }
.back-to-top {
  bottom: 28px;
  right: 22px;
  background: var(--text);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.back-to-top.show { opacity: 1; visibility: visible; pointer-events: auto; }
.back-to-top:hover { transform: translateY(-4px); background: var(--primary); }

/* ===== Header ===== */
header {
  position: fixed;
  top: 0;
  width: 100%;
  height: var(--header-h);
  z-index: 1000;
  background: rgba(241, 238, 231, 0.72);
  backdrop-filter: blur(18px) saturate(1.5);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s, box-shadow 0.4s, background 0.5s;
}
body.dark-mode header { background: rgba(26, 26, 46, 0.72); }
header.scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.12);
}
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

/* ===== Brand wordmark (Makcasa-style) ===== */
.brand-mark {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  font-family: var(--font-brand);
  font-weight: 400;
  text-transform: uppercase;
  font-size: 1.65rem;
  letter-spacing: -0.06em;
  font-feature-settings: "kern" 1, "liga" 1, "dlig" 1, "hlig" 1;
  font-kerning: normal;
  font-variant-ligatures: common-ligatures discretionary-ligatures historical-ligatures;
  color: var(--text);
  position: relative;
  padding-bottom: 3px;
  transition: color 0.4s ease;
}
.brand-mark::after {
  content: "";
  position: absolute;
  left: 1px;
  right: 1px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary) 20%, var(--accent) 80%, transparent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.5s var(--ease);
}
.brand-mark:hover::after { transform: scaleX(1); }
.brand-word { display: inline-block; line-height: 1; }
.brand-spark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 -0.05em;
  width: 0.42em;
  height: 0.42em;
  transform: translateY(-0.32em);
  color: var(--primary);
  filter: drop-shadow(0 0 5px rgba(67, 56, 202, 0.35));
  animation: sparkPulse 4.2s ease-in-out infinite;
}
.brand-spark svg { width: 100%; height: 100%; display: block; }
@keyframes sparkPulse {
  0%, 100% { transform: translateY(-0.32em) scale(1) rotate(0deg); opacity: 0.75; }
  50% { transform: translateY(-0.32em) scale(1.22) rotate(8deg); opacity: 1; }
}
.footer-brand-mark { margin-bottom: 12px; color: var(--text); padding-bottom: 0; }
.footer-brand-mark::after { display: none; }

.nav-links {
  display: flex;
  list-style: none;
  gap: 4px;
}
.nav-links li { position: relative; }
.nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.92rem;
  padding: 8px 16px;
  border-radius: 8px;
  transition: color 0.3s ease, background 0.3s ease;
  position: relative;
  display: inline-block;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 4px;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
  border-radius: 2px;
}
.nav-links a:hover,
.nav-links a.active { color: var(--text); background: var(--bg-soft); }
.nav-links a.active { color: var(--primary); }
.nav-links a.active::after { transform: scaleX(1); }
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 6px;
}
.hamburger span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: 0.3s var(--ease-spring);
}
.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== Hero ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: calc(var(--header-h) + 40px) 24px 80px;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, #08081a 0%, #0d0d22 40%, #0a0a1c 100%);
  z-index: 0;
  overflow: hidden;
}

/* Soft vignette so text stays readable over the nebula/aurora canvas */
.hero-vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse 70% 55% at 50% 42%, rgba(8,8,20,0) 0%, rgba(8,8,20,0.5) 78%, rgba(8,8,20,0.82) 100%),
    linear-gradient(180deg, rgba(8,8,20,0.1) 0%, transparent 20%, transparent 68%, rgba(8,8,20,0.6) 100%);
  pointer-events: none;
}

/* Starfield + nebula + aurora canvas */
.star-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.32;
  will-change: transform;
}
.orb-1 {
  width: 480px; height: 480px;
  background: #4338ca;
  top: -120px; right: -80px;
  animation: float 20s ease-in-out infinite;
}
.orb-2 {
  width: 360px; height: 360px;
  background: #0891b2;
  bottom: -60px; left: -80px;
  animation: float 24s ease-in-out infinite reverse;
}
.orb-3 {
  width: 220px; height: 220px;
  background: #818cf8;
  top: 40%; left: 45%;
  opacity: 0.18;
  animation: float 18s ease-in-out infinite;
}
.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 10%, transparent 70%);
  animation: gridPan 50s linear infinite;
}
@keyframes gridPan {
  0% { background-position: 0 0, 0 0; }
  100% { background-position: 64px 64px, 64px 64px; }
}

/* ambient particles */
.particles { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.particle {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255,255,255,0.45);
  animation: particleFloat linear infinite;
}
@keyframes particleFloat {
  0% { transform: translateY(0); opacity: 0; }
  10% { opacity: 0.6; }
  90% { opacity: 0.4; }
  100% { transform: translateY(-100vh); opacity: 0; }
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 780px;
  color: #fff;
}
.hero-eyebrow {
  display: inline-block;
  padding: 7px 18px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.3px;
  margin-bottom: 26px;
  backdrop-filter: blur(8px);
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 3.8rem);
  font-weight: 700;
  line-height: 1.12;
  margin-bottom: 20px;
  letter-spacing: -1.2px;
}
.highlight {
  background: linear-gradient(105deg, #a5b4fc 0%, #67e8f9 40%, #fbbf24 60%, #a5b4fc 100%);
  background-size: 300% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 10s linear infinite;
}
.hero-subtitle {
  font-size: 1.15rem;
  color: rgba(255,255,255,0.72);
  margin-bottom: 36px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}
.hero-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 56px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  font-family: var(--font);
  transition: transform 0.35s var(--ease-spring), box-shadow 0.35s var(--ease), background 0.3s;
  position: relative;
  overflow: hidden;
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.3), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s ease;
}
.btn:hover::before { opacity: 1; }
.btn i { font-size: 0.85rem; transition: transform 0.3s var(--ease); }
.btn-primary { background: #fff; color: #0f172a; }
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(255,255,255,0.18);
}
.btn-primary:hover i { transform: translateX(3px); }
.btn-secondary {
  background: transparent;
  color: #fff;
  border: 1.5px solid rgba(255,255,255,0.3);
}
.btn-secondary:hover {
  background: rgba(255,255,255,0.08);
  transform: translateY(-3px);
  border-color: rgba(255,255,255,0.5);
}
.btn.full { width: 100%; justify-content: center; }
.hero-stats { display: flex; justify-content: center; gap: 48px; flex-wrap: wrap; }
.stat { text-align: center; }
.stat-num {
  display: block;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -1px;
  background: linear-gradient(90deg, #a5b4fc, #67e8f9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-label { font-size: 0.85rem; color: rgba(255,255,255,0.55); font-weight: 500; }
.scroll-indicator {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  animation: bob 2.4s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(6px); }
}
.scroll-indicator span {
  display: block;
  width: 22px;
  height: 34px;
  border: 2px solid rgba(255,255,255,0.35);
  border-radius: 12px;
  position: relative;
}
.scroll-indicator span::before {
  content: "";
  position: absolute;
  width: 3px;
  height: 7px;
  background: #fff;
  border-radius: 2px;
  left: 50%;
  top: 6px;
  transform: translateX(-50%);
  animation: scroll 1.8s ease-in-out infinite;
}

/* ===== Sections Common ===== */
section { padding: 110px 0; position: relative; }
.section-header { text-align: center; margin-bottom: 52px; }
.section-tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 10px;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  letter-spacing: -0.6px;
  position: relative;
  overflow: hidden;
  padding-bottom: 2px;
}
.title-inner {
  display: inline-block;
  transform: translateY(115%);
  transition: transform 0.9s var(--ease);
}
.section-header.visible .title-inner { transform: translateY(0); }
.section-title::after {
  content: "";
  display: block;
  width: 40px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  margin: 14px auto 0;
  border-radius: 2px;
  transition: width 0.6s var(--ease);
}
.section-header.visible .section-title::after { width: 70px; }

/* ===== About ===== */
.about { background: var(--bg-alt); }
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
  margin-bottom: 64px;
}
.about-text p { color: var(--text-muted); margin-bottom: 18px; font-size: 1.05rem; line-height: 1.8; }
.about-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.about-tags span {
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  cursor: default;
}
.about-tags span:hover { background: var(--primary); color: #fff; border-color: transparent; }
.stagger-group > * {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease), background 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.stagger-group.visible > * { opacity: 1; transform: translateY(0); }

.skills { position: relative; }
.skills h3 { font-size: 1.2rem; margin-bottom: 22px; font-weight: 600; position: relative; display: inline-block; }
.skills h3::after {
  content: "";
  display: block;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 2px;
  margin-top: 6px;
  transition: width 0.7s var(--ease);
}
.skills.visible h3::after { width: 50px; }
.skills-list { display: flex; flex-direction: column; gap: 18px; }
.skill-item {
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--border);
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease),
              box-shadow 0.3s var(--ease), border-color 0.3s;
  position: relative;
  overflow: hidden;
}
.skill-item::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, var(--primary), var(--accent));
  opacity: 0;
  transition: opacity 0.3s ease;
}
.skill-item:hover { box-shadow: var(--shadow); border-color: var(--primary); }
.skill-item:hover::before { opacity: 1; }
.skill-item.visible { opacity: 1; transform: translateY(0); }
.skill-item:nth-child(1) { transition-delay: 0s; }
.skill-item:nth-child(2) { transition-delay: 0.1s; }
.skill-item:nth-child(3) { transition-delay: 0.2s; }
.skill-item:nth-child(4) { transition-delay: 0.3s; }
.skill-top { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.skill-icon {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}
.skill-meta { flex: 1; display: flex; justify-content: space-between; align-items: center; }
.skill-meta h4 { font-size: 0.95rem; font-weight: 600; }
.skill-pct { font-size: 0.85rem; font-weight: 600; color: var(--primary); }
.progress { height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; }
.progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 3px;
  transition: width 1.4s var(--ease);
}

/* Certificates */
.certificate-section {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow);
}
.certificate-header { display: flex; align-items: center; gap: 16px; margin-bottom: 28px; }
.certificate-icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.certificate-header h3 { font-size: 1.25rem; margin-bottom: 2px; }
.certificate-header p { color: var(--text-muted); font-size: 0.92rem; }
.certificate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
}
.certificate-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s ease;
}
.certificate-card.visible { opacity: 1; transform: translateY(0); }
.certificate-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: rgba(67, 56, 202, 0.35); }
.certificate-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,0.22), transparent 62%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}
.certificate-card:hover::after { opacity: 1; }
.certificate-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  cursor: pointer;
  transition: transform 0.5s var(--ease);
}
.certificate-card:hover img { transform: scale(1.05); }

/* ===== Projects ===== */
.projects { background: var(--bg); }
.project-filters { display: flex; justify-content: center; gap: 8px; margin-bottom: 40px; flex-wrap: wrap; }
.filter-btn {
  padding: 9px 20px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.3s var(--ease);
}
.filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.filter-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 20px rgba(67, 56, 202, 0.28);
}
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 28px;
}
.project-card {
  background: var(--bg-alt);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease), box-shadow 0.4s var(--ease);
  display: flex;
  flex-direction: column;
}
.project-card.visible { opacity: 1; transform: translateY(0); }
.project-card.hidden {
  opacity: 0 !important;
  transform: scale(0.94) !important;
  pointer-events: none;
  position: absolute;
  visibility: hidden;
}
.project-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); border-color: rgba(67, 56, 202, 0.35); }
.project-card {
  position: relative;
}
.project-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,0.14), transparent 62%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  border-radius: inherit;
}
.project-card:hover::after { opacity: 1; }
.project-image { position: relative; height: 200px; overflow: hidden; }
.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
  cursor: pointer;
}
.project-card:hover .project-image img { transform: scale(1.06); }
.project-overlay {
  position: absolute;
  inset: 0;
  background: rgba(26, 26, 46, 0.5);
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 0.35s ease;
  color: #fff;
  font-size: 1.4rem;
  pointer-events: none;
}
.project-card:hover .project-overlay { opacity: 1; }
.project-info { padding: 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.project-category {
  display: inline-block;
  width: fit-content;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(67, 56, 202, 0.1);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 600;
}
body.dark-mode .project-category { background: rgba(129, 140, 248, 0.16); }
.project-info h3 { font-size: 1.2rem; font-weight: 600; letter-spacing: -0.3px; }
.project-info p { color: var(--text-muted); font-size: 0.92rem; line-height: 1.65; flex: 1; }
.project-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.project-tags span {
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--bg-soft);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}
.btn-small {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding: 10px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  transition: transform 0.3s var(--ease-spring), box-shadow 0.3s var(--ease);
}
.btn-small:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(67, 56, 202, 0.32); }
.btn-small i { font-size: 0.75rem; transition: transform 0.3s; }
.btn-small:hover i { transform: translateX(3px); }

/* Filter morph transition */
.project-card.morph-out {
  opacity: 0 !important;
  transform: scale(0.94) !important;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.project-card.morph-in { animation: morphIn 0.5s var(--ease) both; }
@keyframes morphIn {
  0% { opacity: 0; transform: translateY(12px) scale(0.97); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== Contact ===== */
.contact { background: var(--bg-alt); }
.contact-wrapper {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 48px;
  align-items: start;
  max-width: 960px;
  margin: 0 auto;
}
.contact-info h3 { font-family: var(--font-display); font-size: 1.5rem; margin-bottom: 10px; letter-spacing: -0.3px; }
.contact-info > p { color: var(--text-muted); margin-bottom: 32px; line-height: 1.75; }
.contact-details { display: flex; flex-direction: column; gap: 14px; margin-bottom: 32px; }
.contact-item {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--text);
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  transition: opacity 0.6s var(--ease), border-color 0.3s, transform 0.3s var(--ease), box-shadow 0.3s;
}
.contact-item:hover { border-color: var(--primary); transform: translateX(4px); box-shadow: var(--shadow); }
.contact-item i {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 0.95rem;
}
.contact-item .label { display: block; font-size: 0.75rem; color: var(--text-muted); font-weight: 500; }
.contact-item span:last-child { font-size: 0.95rem; font-weight: 500; }
.social-links { display: flex; gap: 10px; }
.social-links a {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  display: grid;
  place-items: center;
  text-decoration: none;
  font-size: 1.15rem;
  transition: transform 0.3s var(--ease-spring);
}
.social-links a:hover { transform: translateY(-3px); }
.contact-form {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Floating labels */
.form-group { position: relative; }
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 22px 16px 10px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: var(--font);
  background: var(--bg-alt);
  color: var(--text);
  transition: border-color 0.3s, box-shadow 0.3s;
  resize: none;
}
.form-group label {
  position: absolute;
  left: 16px;
  top: 16px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  pointer-events: none;
  transition: transform 0.25s var(--ease), font-size 0.25s var(--ease), color 0.25s ease, top 0.25s ease;
  transform-origin: left top;
}
.form-group.textarea-group label { top: 18px; }
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67, 56, 202, 0.15);
}
.form-group.focused label,
.form-group.filled label {
  transform: translateY(-8px) scale(0.8);
  color: var(--primary);
  font-weight: 600;
}
.field-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, color 0.3s ease;
}
.form-group.textarea-group .field-icon { top: 20px; transform: none; }
.form-group.focused .field-icon,
.form-group.filled .field-icon { opacity: 0.9; color: var(--primary); }

.check-draw path {
  stroke-dasharray: 28;
  stroke-dashoffset: 28;
  animation: drawCheck 0.5s var(--ease) forwards 0.05s;
}
@keyframes drawCheck { to { stroke-dashoffset: 0; } }

.contact-form .btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  margin-top: 4px;
  transition: transform 0.35s var(--ease-spring), box-shadow 0.35s var(--ease), background 0.4s ease;
}
.contact-form .btn-primary:hover { box-shadow: 0 12px 28px rgba(67, 56, 202, 0.32); }
.contact-form .btn-primary.success { animation: successPulse 0.5s var(--ease); }
@keyframes successPulse {
  0% { transform: scale(1); }
  50% { transform: scale(0.97); }
  100% { transform: scale(1); }
}

/* Ambient glow behind contact form */
.contact { position: relative; overflow: hidden; }
.contact::before {
  content: "";
  position: absolute;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(67,56,202,0.1), transparent 70%);
  top: 10%;
  right: -10%;
  filter: blur(40px);
  pointer-events: none;
}

/* ===== Footer ===== */
footer {
  background: var(--bg);
  color: var(--text-muted);
  padding: 56px 0 0;
  border-top: 1px solid var(--border);
}
.footer-content { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding-bottom: 40px; }
.footer-brand p { font-size: 0.92rem; line-height: 1.7; max-width: 280px; }
.footer-links h4, .footer-social-wrap h4 { color: var(--text); font-size: 0.95rem; margin-bottom: 14px; font-weight: 600; }
.footer-links ul { list-style: none; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: var(--text-muted); text-decoration: none; font-size: 0.92rem; transition: color 0.25s; }
.footer-links a:hover { color: var(--accent); }
.footer-social { display: flex; gap: 10px; }
.footer-social a {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(129, 140, 248, 0.15);
  color: var(--primary);
  display: grid;
  place-items: center;
  text-decoration: none;
  transition: background 0.3s ease, color 0.3s ease, transform 0.3s var(--ease-spring);
}
.footer-social a:hover { background: var(--primary); color: #fff; transform: translateY(-3px); }
.footer-bottom { border-top: 1px solid var(--border); padding: 20px 0; text-align: center; font-size: 0.88rem; color: var(--text-muted); }

/* ===== Modal ===== */
.image-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(26, 26, 46, 0.92);
  backdrop-filter: blur(12px);
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}
.image-modal.active { display: flex; }
.modal-content {
  max-width: 90%;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 12px;
  animation: zoomIn 0.35s var(--ease);
  box-shadow: 0 24px 70px rgba(0,0,0,0.6);
}
.modal-close {
  position: absolute;
  top: 20px;
  right: 28px;
  font-size: 32px;
  color: #fff;
  cursor: pointer;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  transition: 0.3s var(--ease);
  line-height: 1;
}
.modal-close:hover { background: rgba(255,255,255,0.2); }

/* ===== Keyframes ===== */
@keyframes float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(10px, -14px); }
}
@keyframes scroll {
  0% { top: 6px; opacity: 1; }
  100% { top: 18px; opacity: 0; }
}
@keyframes shimmer {
  0% { background-position: 0% center; }
  100% { background-position: 300% center; }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes zoomIn { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: scale(1); } }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .about-grid, .contact-wrapper { grid-template-columns: 1fr; gap: 36px; }
  .footer-content { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .hamburger { display: flex; }
  .nav-links {
    display: none;
    position: fixed;
    top: var(--header-h);
    left: 0;
    width: 100%;
    flex-direction: column;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    padding: 8px 0;
    gap: 0;
  }
  .nav-links.active { display: flex; }
  .nav-links li { border-bottom: 1px solid var(--border); }
  .nav-links a { display: block; padding: 14px 24px; border-radius: 0; }
  .theme-toggle { top: 88px; right: 16px; width: 42px; height: 42px; }
  .back-to-top { bottom: 20px; right: 16px; width: 42px; height: 42px; }
  section { padding: 80px 0; }
  .hero-stats { gap: 32px; }
  .certificate-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .footer-content { grid-template-columns: 1fr; gap: 28px; }
  .scrollspy { display: none; }
}
@media (max-width: 480px) {
  .hero-buttons { flex-direction: column; align-items: center; }
  .btn { width: 100%; max-width: 280px; justify-content: center; }
  .filter-btn { flex: 1; text-align: center; }
  .project-filters { gap: 6px; }
  .stat-num { font-size: 1.6rem; }
}

/* ============================================================
   Page loader
   ============================================================ */
#pageLoader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: linear-gradient(155deg, #1a1a2e 0%, #22223a 45%, #1a1a2e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 22px;
  transition: opacity 0.8s var(--ease), visibility 0.8s var(--ease);
}
#pageLoader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-mark {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-brand);
  font-size: 2.4rem;
  text-transform: uppercase;
  letter-spacing: -0.06em;
  color: #fff;
  opacity: 0;
  transform: translateY(16px);
  animation: loaderEnter 0.7s var(--ease) both;
}
.loader-spark {
  display: inline-flex;
  width: 0.36em;
  height: 0.36em;
  margin: 0 -0.04em;
  transform: translateY(-0.32em);
  color: #67e8f9;
}
.loader-spark svg { width: 100%; height: 100%; }
@keyframes loaderEnter {
  0% { opacity: 0; transform: translateY(16px); }
  100% { opacity: 1; transform: translateY(0); }
}
.loader-bar-track {
  width: 160px;
  height: 2px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}
.loader-bar-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0%;
  background: linear-gradient(90deg, #818cf8, #22d3ee);
  border-radius: 2px;
  animation: loaderProgress 1.8s var(--ease) forwards 0.15s;
}
@keyframes loaderProgress { 0% { width: 0%; } 100% { width: 100%; } }
body.loading { overflow: hidden; }

/* Hero content settle-in after loader (plain transition so scroll JS can take over cleanly) */
.hero-content { opacity: 0; transition: opacity 1s var(--ease); }
.hero-content.hero-loaded { opacity: 1; }

/* ============================================================
   Marquee ticker + scrollspy dots
   ============================================================ */
.ticker-strip { position: relative; overflow: hidden; background: var(--text); padding: 16px 0; z-index: 3; }
body.dark-mode .ticker-strip { background: #050510; }
.ticker-track { display: flex; width: max-content; animation: tickerScroll 34s linear infinite; will-change: transform; }
.ticker-strip:hover .ticker-track { animation-play-state: paused; }
@keyframes tickerScroll { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
.ticker-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 28px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--bg);
  white-space: nowrap;
}
.ticker-item i { font-size: 0.6rem; color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .ticker-track { animation: none; } }

.scrollspy {
  position: fixed;
  right: 26px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}
.scrollspy-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: transparent;
  border: 1.5px solid var(--text-muted);
  cursor: pointer;
  transition: transform 0.3s var(--ease-spring), background 0.3s ease, border-color 0.3s ease;
  position: relative;
}
.scrollspy-dot::after {
  content: attr(data-label);
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.scrollspy-dot:hover::after { opacity: 1; }
.scrollspy-dot.active { background: var(--primary); border-color: var(--primary); transform: scale(1.3); }

/* Scroll progress bar */
#scrollProgress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--amber));
  z-index: 1001;
  transition: width 0.1s linear;
}

@media (prefers-reduced-motion: reduce) {
  #pageLoader { display: none; }
  .hero-content.hero-loaded { animation: none; opacity: 1; transform: none; }
  .skill-item, .certificate-card, .project-card { opacity: 1 !important; transform: none !important; }
}