/* =========================================
   COMPONENTS.CSS — Cards, Buttons, Badges,
   Modals, Progress Bars, Timeline Items
   ========================================= */

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: transform var(--transition-base),
              box-shadow var(--transition-base),
              opacity var(--transition-base),
              background var(--transition-theme);
  white-space: nowrap;
  min-height: 44px;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

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

.btn:hover::after {
  background: rgba(255, 255, 255, 0.07);
}

.btn:active {
  transform: scale(0.97);
}

/* Primary gradient button */
.btn--primary {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  color: #fff;
  border: none;
  box-shadow: 0 4px 20px rgba(79, 142, 247, 0.35);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(79, 142, 247, 0.5),
              0 0 0 1px rgba(79, 142, 247, 0.3);
}

/* Ghost / glass outlined button */
.btn--ghost {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
}

.btn--ghost:hover {
  transform: translateY(-2px);
  border-color: var(--accent-1);
  box-shadow: 0 0 20px rgba(79, 142, 247, 0.2),
              0 8px 24px rgba(0, 0, 0, 0.2);
  color: var(--accent-1);
}

/* Icon button */
.btn--icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--radius-full);
  font-size: var(--text-lg);
}

/* Small */
.btn--sm {
  padding: 8px 18px;
  font-size: var(--text-xs);
  min-height: 36px;
}

.btn--disabled {
  pointer-events: none;
  opacity: 0.6;
  cursor: not-allowed;
}

/* ---------- Social Icon Buttons ---------- */
.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  font-size: var(--text-lg);
  transition: transform var(--transition-base),
              color var(--transition-base),
              box-shadow var(--transition-base),
              border-color var(--transition-base),
              background var(--transition-theme);
  text-decoration: none;
}

.social-icon:hover {
  transform: translateY(-3px);
  color: var(--accent-1);
  border-color: rgba(79, 142, 247, 0.5);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2),
              0 0 16px rgba(79, 142, 247, 0.25);
}

/* ---------- Theme Toggle Button ---------- */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  font-size: var(--text-lg);
  cursor: pointer;
  transition: background var(--transition-base),
              border-color var(--transition-base),
              transform var(--transition-base);
  position: relative;
  overflow: hidden;
}

.theme-toggle:hover {
  transform: rotate(20deg);
  border-color: rgba(255, 200, 60, 0.4);
  box-shadow: 0 0 16px rgba(255, 200, 60, 0.2);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  position: absolute;
  transition: transform var(--transition-base), opacity var(--transition-base);
}

[data-theme="dark"] .theme-toggle .icon-sun {
  transform: rotate(0deg);
  opacity: 1;
}
[data-theme="dark"] .theme-toggle .icon-moon {
  transform: rotate(90deg) scale(0);
  opacity: 0;
}
[data-theme="light"] .theme-toggle .icon-sun {
  transform: rotate(-90deg) scale(0);
  opacity: 0;
}
[data-theme="light"] .theme-toggle .icon-moon {
  transform: rotate(0deg);
  opacity: 1;
}

/* ---------- Profile Image Frame ---------- */
.profile-frame {
  position: relative;
  width: clamp(260px, 30vw, 380px);
  height: clamp(260px, 30vw, 380px);
  flex-shrink: 0;
  animation: float 6s ease-in-out infinite 1.2s;
}

.profile-frame__ring {
  position: absolute;
  inset: -4px;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2), var(--accent-3));
  padding: 3px;
}

.profile-frame__ring::before {
  content: '';
  display: block;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-xl);
  background: var(--bg-body);
}

.profile-frame__img-wrap {
  position: absolute;
  inset: 8px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: transparent;
  border: none;
  z-index: 0;
}

.profile-frame__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: var(--radius-xl);
  display: block;
}

/* Floating stat badges always on top of the image */
.profile-frame .glass-stat {
  z-index: 2;
}

/* ---------- Project Card ---------- */
.project-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  transition: transform var(--transition-base),
              box-shadow var(--transition-base),
              border-color var(--transition-base),
              background var(--transition-theme);
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4),
              0 0 0 1px rgba(79, 142, 247, 0.4);
  border-color: rgba(79, 142, 247, 0.3);
}

.project-card__image {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.project-card__image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--glass-bg);
  transition: transform var(--transition-slow);
}

.project-card:hover .project-card__image img {
  transform: scale(1.06);
}

.project-card__image-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--transition-base);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: var(--space-3);
  gap: var(--space-2);
}

.project-card:hover .project-card__image-overlay {
  opacity: 1;
}

.project-card__body {
  padding: var(--space-3) var(--space-4);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.project-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.project-card__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.project-card__desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.6;
  flex: 1;
}

.project-card__footer {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--glass-border);
  margin-top: auto;
}

.project-popup-open {
  overflow: hidden;
}

.project-grid--popup-active .project-card {
  opacity: 0.26;
  transform: scale(0.985);
  transition: opacity 160ms ease, transform 180ms ease;
  will-change: opacity, transform;
}

.project-grid--popup-active .project-card--selected {
  opacity: 0;
}

.project-popup-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1090;
  background: rgba(4, 9, 20, 0.5);
  backdrop-filter: blur(6px) saturate(108%);
  -webkit-backdrop-filter: blur(6px) saturate(108%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms ease;
  will-change: opacity;
}

.project-popup-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.project-popup-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: grid;
  place-items: center;
  padding: clamp(12px, 2.4vw, 30px);
  pointer-events: none;
}

.project-card--popup {
  position: relative;
  width: min(860px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  transform: translateY(0) scale(1);
  opacity: 1;
  filter: none;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.58),
              0 0 0 1px rgba(255, 255, 255, 0.09),
              0 0 50px rgba(79, 142, 247, 0.26);
  border-color: rgba(255, 255, 255, 0.2);
  transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1),
              opacity 240ms ease;
  pointer-events: auto;
  will-change: transform, opacity;
}

.project-card--popup:hover {
  transform: translateY(0) scale(1);
}

.project-popup-modal.is-entering .project-card--popup {
  transform: translateY(34px) scale(0.88);
  opacity: 0;
}

.project-popup-modal.is-closing .project-card--popup {
  transform: translateY(22px) scale(0.92);
  opacity: 0;
}

.project-card--popup .project-card__image-overlay {
  opacity: 1;
}

.project-popup-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: rgba(8, 12, 24, 0.8);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.project-popup-close:hover {
  transform: scale(1.06);
  background: rgba(79, 142, 247, 0.26);
  border-color: rgba(79, 142, 247, 0.65);
}

@media (max-width: 768px) {
  .project-card--popup {
    width: min(96vw, 640px);
    max-height: 90vh;
  }

  .project-card--popup .project-card__body {
    padding: var(--space-3);
  }
}

/* ---------- Filter Tabs ---------- */
.filter-btn {
  padding: 8px 20px;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  transition: all var(--transition-base);
  min-height: 40px;
}

.filter-btn:hover {
  color: var(--text-primary);
  border-color: rgba(79, 142, 247, 0.4);
}

.filter-btn.active {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(79, 142, 247, 0.35);
}

/* ---------- Skill Progress Bar ---------- */
.skill-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skill-bar__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.skill-bar__pct {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--accent-1);
}

.skill-bar__track {
  height: 8px;
  width: 100%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.skill-bar__fill {
  height: 100%;
  width: 0; /* animated via JS */
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  box-shadow: 0 0 10px rgba(79, 142, 247, 0.4);
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Counter Card ---------- */
.counter-card {
  text-align: center;
  padding: var(--space-4);
}

.counter-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin: 0 auto var(--space-2);
  border-radius: var(--radius-md);
  font-size: 24px;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  box-shadow: 0 4px 16px rgba(79, 142, 247, 0.3);
}

.counter-card__number {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.counter-card__label {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: 4px;
}

/* ---------- Timeline Card ---------- */
.timeline__card {
  padding: var(--space-4);
  border-radius: var(--radius-lg);
}

.timeline__card-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.timeline__logo {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  object-fit: contain;
  flex-shrink: 0;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
}

.timeline__logo:not([src]),
.timeline__logo[src=""] {
  min-height: unset;
  display: flex;
  align-items: center;
  justify-content: center;
}

.timeline__meta {
  flex: 1;
}

.timeline__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--text-primary);
}

.timeline__company {
  font-size: var(--text-sm);
  color: var(--accent-1);
  font-weight: 500;
}

.timeline__date {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 4px;
}

.timeline__bullets {
  margin-top: var(--space-2);
  padding-left: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.timeline__bullets li {
  font-size: var(--text-sm);
  color: var(--text-muted);
  position: relative;
  padding-left: var(--space-3);
  line-height: 1.6;
}

.timeline__bullets li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent-1);
}

/* ---------- Testimonial Card ---------- */
.testimonial-card {
  padding: var(--space-5);
  border-radius: var(--radius-lg);
}

.testimonial-card__quote {
  font-size: var(--text-base);
  color: var(--text-muted);
  line-height: 1.8;
  font-style: italic;
  margin-bottom: var(--space-4);
  position: relative;
  padding-left: var(--space-3);
}

.testimonial-card__quote::before {
  content: '"';
  position: absolute;
  top: -10px;
  left: -4px;
  font-size: 4rem;
  color: var(--accent-1);
  opacity: 0.3;
  font-family: var(--font-display);
  line-height: 1;
}

.testimonial-card__author {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.testimonial-card__avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--glass-border);
}

.testimonial-card__name {
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--text-primary);
  font-family: var(--font-display);
}

.testimonial-card__role {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

/* ---------- Contact Form ---------- */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

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

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

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

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

textarea.glass-input {
  resize: vertical;
  min-height: 140px;
}

/* ---------- Contact Info ---------- */
.contact-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.contact-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.contact-item__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  font-size: 20px;
  background: linear-gradient(135deg, rgba(79,142,247,0.15), rgba(155,89,245,0.15));
  border: 1px solid rgba(79, 142, 247, 0.2);
  flex-shrink: 0;
}

.contact-item__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.contact-item__label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

.contact-item__value {
  font-size: var(--text-base);
  color: var(--text-primary);
  font-weight: 500;
}

/* ---------- Custom Cursor ---------- */
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: var(--z-cursor);
  mix-blend-mode: screen;
}

.cursor__dot {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-1);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px var(--accent-1),
              0 0 20px rgba(79, 142, 247, 0.5);
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.cursor__ring {
  position: absolute;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid rgba(79, 142, 247, 0.5);
  transform: translate(-50%, -50%);
  transition: width 0.2s ease, height 0.2s ease, transform 0.12s ease;
}

body:has(a:hover, button:hover) .cursor__ring {
  width: 48px;
  height: 48px;
  border-color: var(--accent-1);
}

@media (hover: none) {
  .cursor { display: none; }
}

/* ---------- Hero Headline ---------- */
.hero__content {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.hero__headline {
  font-size: var(--text-6xl);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text-primary);
}

.hero__typewriter-wrap {
  display: block;
  min-height: 1.2em;
}

.hero__typewriter {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2), var(--accent-3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.typewriter-cursor {
  display: inline-block;
  width: 3px;
  height: 0.85em;
  background: var(--accent-1);
  margin-left: 3px;
  vertical-align: middle;
  animation: blink 0.8s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.hero__bio {
  font-size: var(--text-lg);
  color: var(--text-muted);
  max-width: 480px;
  line-height: 1.75;
}

.hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-1);
}

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

@media (max-width: 1024px) {
  .hero__bio { max-width: 100%; }
  .hero__ctas { justify-content: center; }
  .hero__socials { justify-content: center; }
  .hero__content { align-items: center; }
}

@media (max-width: 768px) {
  .hero__headline {
    font-size: clamp(2.5rem, 7vw + 1rem, 3.5rem);
  }
  .hero__content {
    gap: var(--space-2);
  }
  .profile-frame {
    width: clamp(200px, 50vw, 280px);
    height: clamp(200px, 50vw, 280px);
  }
  .profile-frame .glass-stat {
    transform: scale(0.85);
  }
}

@media (max-width: 480px) {
  .hero__headline {
    font-size: clamp(2rem, 8vw, 2.8rem);
  }
  .hero__bio {
    font-size: var(--text-base);
    line-height: 1.6;
  }
  .hero__ctas {
    flex-direction: column;
    align-items: center;
    width: 100%;
  }
  .hero__ctas .btn {
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }
  .profile-frame {
    width: clamp(180px, 55vw, 240px);
    height: clamp(180px, 55vw, 240px);
  }
  .profile-frame .glass-stat {
    display: none;
  }
}
