/* ============================
   LAYOUT
   ============================ */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.section {
  padding: var(--section-padding);
  position: relative;
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-12);
}

.section-tag {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--accent-secondary);
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: var(--space-2);
}

.section-title {
  font-size: clamp(var(--text-3xl), 5vw, var(--text-5xl));
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

/* ============================
   NAVBAR
   ============================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--navbar-height);
  z-index: 1000;
  border-radius: 0;
  border-top: none;
  border-left: none;
  border-right: none;
  transition: all var(--transition-base);
}

.navbar.scrolled {
  background: var(--glass-bg);
  box-shadow: var(--shadow-md);
}

.nav-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-primary);
}

.logo-bracket {
  color: var(--accent-primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.nav-link {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: color var(--transition-fast), background var(--transition-fast);
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 80%;
  height: 2px;
  background: var(--accent-gradient);
  border-radius: var(--radius-full);
  transition: transform var(--transition-bounce);
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
}

.nav-link:hover::after,
.nav-link.active::after {
  transform: translateX(-50%) scaleX(1);
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.ctrl-btn {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: all var(--transition-fast);
}

.ctrl-btn:hover {
  background: var(--glass-bg-hover);
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

/* ============================
   BUTTONS
   ============================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 600;
  border: 2px solid transparent;
  transition: all var(--transition-bounce);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  letter-spacing: 0.02em;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity var(--transition-fast);
  background: rgba(255, 255, 255, 0.15);
  border-radius: inherit;
}

.btn:hover::before {
  opacity: 1;
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(124, 58, 237, 0.5);
}

.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--glass-border);
  backdrop-filter: var(--glass-blur);
}

.btn-ghost:hover {
  background: var(--glass-bg);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}

.btn-outline:hover {
  background: var(--accent-primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

/* ============================
   HERO SECTION
   ============================ */
.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  gap: var(--space-12);
  max-width: var(--container-max);
  margin: 0 auto;
  padding: calc(var(--navbar-height) + var(--space-8)) var(--space-6) var(--space-8);
}

.hero-content {
  flex: 1;
}

.hero-greeting {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--accent-secondary);
  letter-spacing: 0.1em;
  margin-bottom: var(--space-2);
}

.hero-name {
  font-size: clamp(var(--text-4xl), 8vw, var(--text-6xl));
  font-weight: 800;
  line-height: 1.1;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-4);
}

.hero-role {
  font-size: clamp(var(--text-xl), 3vw, var(--text-3xl));
  color: var(--text-secondary);
  margin-bottom: var(--space-6);
}

.typewriter {
  color: var(--accent-primary);
  font-weight: 700;
}

.cursor-blink {
  color: var(--accent-primary);
  animation: blink 1s step-end infinite;
}

.hero-bio {
  color: var(--text-secondary);
  font-size: var(--text-lg);
  max-width: 480px;
  margin-bottom: var(--space-8);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.hero-socials {
  display: flex;
  gap: var(--space-4);
}

.social-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-md);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  display: grid;
  place-items: center;
  font-size: var(--text-lg);
  color: var(--text-secondary);
  transition: all var(--transition-bounce);
}

.social-icon:hover {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}

/* AVATAR */
.hero-visual {
  flex: 0 0 380px;
  display: grid;
  place-items: center;
}

.avatar-wrapper {
  position: relative;
  width: 300px;
  height: 300px;
}

.avatar-img {
  width: 260px;
  height: 260px;
  border-radius: 50%;
  object-fit: cover;
  position: relative;
  z-index: 2;
  margin: 20px auto 0;
  border: 3px solid var(--accent-primary);
  filter: drop-shadow(0 0 20px rgba(124, 58, 237, 0.4));
}

.avatar-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid transparent;
  animation: rotate-ring 8s linear infinite;
}

.ring-1 {
  inset: 0;
  border-top-color: var(--accent-primary);
  border-right-color: var(--accent-primary);
  opacity: 0.6;
}

.ring-2 {
  inset: -15px;
  border-bottom-color: var(--accent-secondary);
  border-left-color: var(--accent-secondary);
  animation-direction: reverse;
  animation-duration: 12s;
  opacity: 0.4;
}

.avatar-glow {
  position: absolute;
  inset: 20px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.2), transparent 70%);
  z-index: 1;
  animation: pulse-glow 3s ease-in-out infinite;
}

/* ============================
   ABOUT
   ============================ */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  align-items: center;
}

.about-text {
  order: 1;
}

.about-image {
  order: 2;
}

.image-card {
  padding: var(--space-4);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.image-card img {
  border-radius: var(--radius-lg);
  width: 100%;
  object-fit: cover;
}

.about-stats {
  display: flex;
  gap: var(--space-4);
  margin: var(--space-8) 0;
}

.stat-item {
  flex: 1;
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  text-align: center;
}

.stat-number {
  font-size: var(--text-4xl);
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
  display: block;
}

.stat-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  font-weight: 500;
}

/* ============================
   SKILL CARDS
   ============================ */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-6);
}

.skill-card {
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  text-align: center;
  transition: all var(--transition-bounce);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
}

.skill-card:hover {
  transform: translateY(-6px) scale(1.03);
  box-shadow: var(--shadow-glow);
  border-color: var(--accent-primary);
}

.skill-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-2);
  display: block;
  transition: transform var(--transition-bounce);
}

.skill-card:hover .skill-icon {
  transform: scale(1.2) rotate(-5deg);
}

.skill-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.skill-level {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

.skill-bar {
  height: 3px;
  background: var(--border-color);
  border-radius: var(--radius-full);
  margin-top: var(--space-2);
  overflow: hidden;
}

.skill-bar-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: var(--radius-full);
  width: 0;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
  justify-content: center;
}

.tab {
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 500;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.tab.active,
.tab:hover {
  background: var(--accent-gradient);
  color: white;
  border-color: transparent;
  box-shadow: var(--shadow-glow);
}

/* ============================
   PROJECT CARDS
   ============================ */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-6);
}

.project-card {
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  transition: all var(--transition-slow);
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  border-color: var(--accent-primary);
}

.project-thumbnail {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

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

.project-body {
  padding: var(--space-6);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.project-tag {
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  font-family: var(--font-mono);
  background: rgba(124, 58, 237, 0.15);
  color: var(--accent-primary);
  border: 1px solid rgba(124, 58, 237, 0.3);
}

.project-title {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-primary);
}

.project-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  flex: 1;
  line-height: 1.6;
}

.project-links {
  display: flex;
  gap: var(--space-3);
  margin-top: auto;
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-color);
}

.project-link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.project-link:hover {
  color: var(--accent-primary);
}

.project-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-8);
  justify-content: center;
}

.filter-btn {
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 500;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.filter-btn.active,
.filter-btn:hover {
  background: var(--accent-primary);
  color: white;
  border-color: transparent;
  box-shadow: var(--shadow-glow);
}

.project-badge {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  background: var(--accent-gradient);
  color: white;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  z-index: 10;
  box-shadow: var(--shadow-md);
}

/* ============================
   TIMELINE
   ============================ */
.timeline {
  position: relative;
  max-width: 700px;
  margin: 0 auto;
  padding: var(--space-4) 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent-gradient);
  transform: translateX(-50%);
}

.timeline-item {
  display: flex;
  justify-content: flex-end;
  padding-right: calc(50% + var(--space-8));
  margin-bottom: var(--space-10);
  position: relative;
}

.timeline-item:nth-child(even) {
  justify-content: flex-start;
  padding-right: 0;
  padding-left: calc(50% + var(--space-8));
}

.timeline-dot {
  position: absolute;
  left: 50%;
  top: var(--space-4);
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-gradient);
  border: 3px solid var(--bg-base);
  z-index: 1;
  box-shadow: var(--shadow-glow);
}

.timeline-content {
  width: 100%;
  padding: var(--space-8);
}

.timeline-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.timeline-icon {
  font-size: var(--text-xl);
}

.timeline-year {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--accent-secondary);
}

.timeline-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
}

.timeline-org {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.timeline-desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* ============================
   CONTACT FORM
   ============================ */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--space-8);
  max-width: 900px;
  margin: 0 auto;
}

.contact-info {
  padding: var(--space-10);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.contact-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  color: var(--text-secondary);
}

.contact-item i {
  font-size: var(--text-lg);
  color: var(--accent-primary);
  width: var(--space-6);
}

.contact-form {
  padding: var(--space-10);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.form-group label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
}

.form-group input,
.form-group textarea {
  padding: var(--space-3) var(--space-4);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: all var(--transition-fast);
  resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
  background: var(--glass-bg-hover);
}

.form-group input.error,
.form-group textarea.error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

/* ============================
   FOOTER, TOAST, BACK-TO-TOP
   ============================ */
.toast {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 9999;
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: 500;
  max-width: 320px;
  opacity: 0;
  transform: translateY(20px);
  transition: all var(--transition-base);
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.toast.success {
  border-left: 3px solid var(--success);
}

.toast.error {
  border-left: 3px solid var(--error);
}

.back-to-top {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-full);
  background: var(--accent-gradient);
  color: white;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-glow);
  opacity: 0;
  transform: translateY(20px);
  transition: all var(--transition-base);
  pointer-events: none;
  z-index: 100;
}

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

.back-to-top:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.footer {
  padding: var(--space-8) var(--space-4);
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.footer-copy {
  color: var(--text-muted);
  font-size: var(--text-sm);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.footer-links {
  display: flex;
  gap: var(--space-6);
}

.footer-links a {
  font-size: var(--text-sm);
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

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