/* ===== Modern vibrant dark UI with advanced animations ===== */

:root {
  --bg: #0a0e1a;
  --bg2: #0f1525;
  --panel: #131a2e;
  --panel2: #1a2342;
  --border: rgba(255, 255, 255, 0.1);
  --text: #f0f4ff;
  --muted: rgba(240, 244, 255, 0.75);
  --muted2: rgba(240, 244, 255, 0.6);

  /* Vibrant gradient colors */
  --accent: #8b5cf6;
  --accent2: #a78bfa;
  --accent3: #06b6d4;
  --accent4: #3b82f6;

  /* Gradient combinations */
  --gradient-primary: linear-gradient(
    135deg,
    #8b5cf6 0%,
    #3b82f6 50%,
    #06b6d4 100%
  );
  --gradient-secondary: linear-gradient(135deg, #a78bfa 0%, #06b6d4 100%);
  --gradient-accent: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);

  --shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 30px rgba(139, 92, 246, 0.3);
  --radius: 18px;

  /* Animation durations - smoother easing */
  --transition-fast: 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition-normal: 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition-slow: 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

/* Smooth scrolling with better performance */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* GPU acceleration for smoother animations */
.card,
.cert,
.profile,
.contact__item,
.btn,
.hero__media,
.avatar,
.section {
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000px;
}
body {
  margin: 0;
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Arial,
    sans-serif;
  background:
    radial-gradient(
      1400px 800px at 15% -5%,
      rgba(139, 92, 246, 0.25),
      transparent 65%
    ),
    radial-gradient(
      1000px 700px at 90% 15%,
      rgba(6, 182, 212, 0.2),
      transparent 60%
    ),
    radial-gradient(
      800px 600px at 50% 50%,
      rgba(59, 130, 246, 0.15),
      transparent 70%
    ),
    linear-gradient(180deg, var(--bg), var(--bg2));
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
}

/* Animated gradient overlay */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(
      circle at 20% 30%,
      rgba(139, 92, 246, 0.1) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 70%,
      rgba(6, 182, 212, 0.1) 0%,
      transparent 50%
    );
  animation: gradientShift 15s ease infinite;
  pointer-events: none;
  z-index: -1;
}

@keyframes gradientShift {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  50% {
    transform: translate(-20px, -30px) scale(1.1);
    opacity: 0.8;
  }
}

/* Smooth page transitions */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

body {
  animation: fadeIn 0.6s ease-out;
}

a {
  color: inherit;
}
img {
  max-width: 100%;
  display: block;
}

.container {
  width: min(1100px, calc(100% - 40px));
  margin: 0 auto;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 10px 12px;
  border-radius: 10px;
}
.skip-link:focus {
  left: 10px;
  z-index: 9999;
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 2000;
  background: rgba(10, 14, 26, 0.8);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  transition: all var(--transition-normal);
  animation: slideDown 0.6s ease-out;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Smooth topbar shadow on scroll */
.topbar {
  transition:
    box-shadow var(--transition-normal),
    background var(--transition-normal);
}

.topbar.scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  background: rgba(10, 14, 26, 0.95);
}
.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 14px;
}

.brand {
  text-decoration: none;
  display: flex;
  align-items: baseline;
  gap: 2px;
  font-weight: 900;
  letter-spacing: 0.5px;
}
.brand__mark {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 18px;
  animation: brandGlow 3s ease-in-out infinite;
}

@keyframes brandGlow {
  0%,
  100% {
    filter: drop-shadow(0 0 5px rgba(139, 92, 246, 0.5));
  }
  50% {
    filter: drop-shadow(0 0 15px rgba(139, 92, 246, 0.8));
  }
}
.brand__dot {
  color: var(--text);
  font-size: 18px;
}

/* Nav */
.nav {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav__link {
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
  border: 1px solid transparent;
}
.nav__link:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(19, 33, 58, 0.45);
}
.nav__link.is-active {
  color: var(--text);
  border-color: rgba(139, 92, 246, 0.4);
  background: rgba(139, 92, 246, 0.15);
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.2);
}
.nav__link--cta {
  color: #0a0e1a;
  background: var(--gradient-primary);
  border-color: transparent;
  position: relative;
  overflow: hidden;
}
.nav__link--cta::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.5s;
}
.nav__link--cta:hover::before {
  left: 100%;
}
.nav__link--cta:hover {
  filter: brightness(1.1);
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
  transform: translateY(-2px);
}

/* Mobile nav */
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(15, 26, 47, 0.55);
  cursor: pointer;
}
.nav-toggle__bar {
  display: block;
  height: 2px;
  width: 18px;
  background: var(--text);
  margin: 4px auto;
  opacity: 0.9;
}

/* Hero */
.hero {
  padding: 56px 0 18px;
  position: relative;
  animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.hero__grid {
  display: grid;
  grid-template-columns: 1.25fr 0.9fr;
  gap: 24px;
  align-items: center;
}
.badge {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(139, 92, 246, 0.4);
  background: rgba(139, 92, 246, 0.15);
  color: var(--accent2);
  font-weight: 800;
  font-size: 13px;
  animation: badgePulse 2s ease-in-out infinite;
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.2);
}

@keyframes badgePulse {
  0%,
  100% {
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.2);
  }
  50% {
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
  }
}
.hero__title {
  margin: 14px 0 8px;
  font-size: clamp(34px, 4vw, 54px);
  letter-spacing: -0.5px;
}
.hero__subtitle {
  margin: 0;
  min-height: 28px;
  color: var(--muted);
  font-size: 16px;
  max-width: 60ch;
}

.hero__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  font-weight: 900;
  font-size: 14px;
}
.btn--primary {
  border-color: transparent;
  color: #0a0e1a;
  background: var(--gradient-primary);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
}
.btn--primary::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.5s;
}
.btn--primary:hover::before {
  left: 100%;
}
.btn--primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 8px 25px rgba(139, 92, 246, 0.5);
  transform: translateY(-2px);
}
.btn--ghost {
  background: rgba(15, 26, 47, 0.45);
  color: var(--text);
}
.btn--ghost:hover {
  background: rgba(19, 33, 58, 0.55);
}

.hero__quick {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.chip {
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(19, 26, 46, 0.5);
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
  transition: all var(--transition-fast);
}

.chip:hover {
  color: var(--text);
  border-color: rgba(139, 92, 246, 0.4);
  background: rgba(139, 92, 246, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.2);
}

.hero__media {
  position: relative;
  padding: 22px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(19, 26, 46, 0.5);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: fadeInRight 0.8s ease-out 0.2s both;
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.avatar {
  width: 260px;
  height: 260px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 18%;
  border: 2px solid rgba(139, 92, 246, 0.3);
  margin: 0 auto;
  filter: contrast(1.05) saturate(1.1);
  animation: avatarFloat 6s ease-in-out infinite;
  box-shadow: 0 0 40px rgba(139, 92, 246, 0.3);
  transition: all var(--transition-slow);
}

.avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 0 60px rgba(139, 92, 246, 0.5);
}

@keyframes avatarFloat {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-10px) rotate(2deg);
  }
}

/* Smooth avatar transitions */
.avatar {
  transition:
    transform var(--transition-slow),
    box-shadow var(--transition-normal),
    filter var(--transition-normal);
}

.avatar__ring {
  position: absolute;
  inset: -60px;
  background: radial-gradient(
    circle at 50% 40%,
    rgba(139, 92, 246, 0.25),
    transparent 55%
  );
  pointer-events: none;
  animation: ringPulse 4s ease-in-out infinite;
}

@keyframes ringPulse {
  0%,
  100% {
    opacity: 0.6;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}
.hero__note {
  margin: 14px 0 0;
  text-align: center;
  color: var(--muted2);
  font-weight: 700;
  font-size: 13px;
}

/* Sections */
.section {
  padding: 34px 0;
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.8s var(--ease-smooth),
    transform 0.8s var(--ease-smooth);
}

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

/* Smooth section transitions */
.section__head {
  transition:
    opacity 0.6s var(--ease-smooth) 0.2s,
    transform 0.6s var(--ease-smooth) 0.2s;
}

.section.visible .section__head {
  opacity: 1;
  transform: translateY(0);
}
.section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.section__title {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.2px;
}
.section__desc {
  margin: 0;
  color: var(--muted);
  max-width: 70ch;
}

/* Panels / cards */
.panel {
  border: 1px solid var(--border);
  background: rgba(19, 26, 46, 0.5);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity var(--transition-normal);
  pointer-events: none;
  z-index: -1;
}

.panel:hover {
  border-color: rgba(139, 92, 246, 0.3);
  box-shadow: 0 15px 40px rgba(139, 92, 246, 0.2);
}

.panel:hover::before {
  opacity: 0.05;
}
.panel__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.panel__title {
  margin: 0 0 10px;
  font-size: 16px;
}

.grid {
  display: grid;
  gap: 14px;
}
.grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
  border: 1px solid var(--border);
  background: rgba(19, 26, 46, 0.5);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px);
  animation: cardFadeIn 0.6s ease-out forwards;
}

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Smooth card hover with scale */
.card {
  transition: all var(--transition-normal) var(--ease-smooth);
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity var(--transition-normal);
  pointer-events: none;
  z-index: -1;
}

.card:hover {
  transform: translateY(-8px) scale(1.02);
  background: rgba(26, 35, 66, 0.7);
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow:
    0 15px 40px rgba(139, 92, 246, 0.3),
    var(--shadow);
}

.card:hover::before {
  opacity: 0.05;
}

/* Stagger animation for cards */
.card:nth-child(1) {
  animation-delay: 0.08s;
}
.card:nth-child(2) {
  animation-delay: 0.16s;
}
.card:nth-child(3) {
  animation-delay: 0.24s;
}
.card:nth-child(4) {
  animation-delay: 0.32s;
}
.card:nth-child(5) {
  animation-delay: 0.4s;
}
.card:nth-child(6) {
  animation-delay: 0.48s;
}

/* Project layout similar to reference design */
.projects-grid {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.card--project {
  min-height: 210px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px 22px 20px;
  border-radius: 24px;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(255, 255, 255, 0.04);
  background:
    linear-gradient(145deg, rgba(7, 11, 24, 0.92), rgba(10, 18, 40, 0.96)),
    radial-gradient(circle at 0% 0%, rgba(139, 92, 246, 0.35), transparent 60%),
    radial-gradient(
      circle at 90% 100%,
      rgba(6, 182, 212, 0.25),
      transparent 55%
    );
}

.card--project-primary {
  background:
    radial-gradient(circle at 0% 0%, rgba(59, 130, 246, 0.6), transparent 60%),
    radial-gradient(
      circle at 90% 100%,
      rgba(6, 182, 212, 0.4),
      transparent 55%
    ),
    linear-gradient(150deg, #020617 0%, #020617 35%, #020617 60%, #020617 100%);
}

.card--project-alt {
  background:
    radial-gradient(circle at 0% 0%, rgba(139, 92, 246, 0.55), transparent 60%),
    radial-gradient(
      circle at 90% 100%,
      rgba(59, 130, 246, 0.4),
      transparent 55%
    ),
    linear-gradient(150deg, #020617 0%, #020617 35%, #020617 60%, #020617 100%);
}

.card--project-soft {
  background:
    radial-gradient(circle at 0% 0%, rgba(244, 114, 182, 0.5), transparent 60%),
    radial-gradient(
      circle at 90% 100%,
      rgba(56, 189, 248, 0.35),
      transparent 55%
    ),
    linear-gradient(150deg, #020617 0%, #020617 35%, #020617 60%, #020617 100%);
}

.card--project-green {
  background:
    radial-gradient(circle at 0% 0%, rgba(34, 197, 94, 0.5), transparent 60%),
    radial-gradient(
      circle at 90% 100%,
      rgba(56, 189, 248, 0.35),
      transparent 55%
    ),
    linear-gradient(150deg, #020617 0%, #020617 35%, #020617 60%, #020617 100%);
}

.card--project .card__top {
  margin-bottom: 16px;
}

.card--project .card__title {
  font-size: 18px;
}

.card--project .card__text {
  max-width: 60ch;
}

.card--project .tags {
  margin-top: 14px;
}

.card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.card__title {
  margin: 0;
  font-size: 16px;
}
.card__text {
  margin: 10px 0 0;
  color: var(--muted);
}

.pill {
  font-size: 12px;
  font-weight: 900;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.4);
  color: var(--accent2);
  white-space: nowrap;
  transition: all var(--transition-fast);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.1);
}

.pill:hover {
  background: rgba(139, 92, 246, 0.25);
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.3);
  transform: scale(1.05);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.tag {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 26, 47, 0.45);
  color: var(--muted);
  font-weight: 800;
}

/* Lists */
.list {
  margin: 0;
  padding-left: 18px;
}
.list--muted li {
  color: var(--muted);
}
.list li {
  margin: 7px 0;
}

/* Cert cards */
.cert {
  text-decoration: none;
  border: 1px solid var(--border);
  background: rgba(19, 26, 46, 0.5);
  border-radius: var(--radius);
  padding: 14px;
  font-weight: 900;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  box-shadow: var(--shadow);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px);
  animation: cardFadeIn 0.6s ease-out forwards;
}

.cert::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--gradient-primary);
  opacity: 0.1;
  transition: left 0.4s;
  z-index: -1;
}

.cert:hover::before {
  left: 0;
}

.cert:hover {
  transform: translateY(-6px) scale(1.03);
  border-color: rgba(139, 92, 246, 0.5);
  background: rgba(26, 35, 66, 0.7);
  box-shadow: 0 12px 35px rgba(139, 92, 246, 0.4);
  -webkit-text-fill-color: var(--text);
}

.cert:nth-child(1) {
  animation-delay: 0.05s;
}
.cert:nth-child(2) {
  animation-delay: 0.1s;
}
.cert:nth-child(3) {
  animation-delay: 0.15s;
}
.cert:nth-child(4) {
  animation-delay: 0.2s;
}
.cert:nth-child(5) {
  animation-delay: 0.25s;
}
.cert:nth-child(6) {
  animation-delay: 0.3s;
}
.cert:nth-child(7) {
  animation-delay: 0.35s;
}
.cert:nth-child(8) {
  animation-delay: 0.4s;
}
.cert:nth-child(9) {
  animation-delay: 0.45s;
}
.cert:nth-child(10) {
  animation-delay: 0.5s;
}
.cert:nth-child(11) {
  animation-delay: 0.55s;
}
.cert:nth-child(12) {
  animation-delay: 0.6s;
}

.hint {
  margin: 14px 0 0;
  color: var(--muted2);
  font-size: 13px;
}

/* Profiles */
.profile {
  text-decoration: none;
  border: 1px solid var(--border);
  background: rgba(19, 26, 46, 0.5);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.profile::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity var(--transition-normal);
  z-index: -1;
}

.profile:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: rgba(139, 92, 246, 0.4);
  background: rgba(26, 35, 66, 0.7);
  box-shadow: 0 12px 35px rgba(139, 92, 246, 0.3);
}

.profile:hover::before {
  opacity: 0.08;
}
.profile__name {
  font-weight: 1000;
}
.profile__meta {
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
}

/* Contact */
.contact {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.contact__item--cv {
  grid-column: 1 / -1;
  background: linear-gradient(
    135deg,
    rgba(139, 92, 246, 0.1),
    rgba(6, 182, 212, 0.1)
  );
  border-color: rgba(139, 92, 246, 0.3);
}

.contact__item--cv:hover {
  background: linear-gradient(
    135deg,
    rgba(139, 92, 246, 0.2),
    rgba(6, 182, 212, 0.2)
  );
  border-color: rgba(139, 92, 246, 0.5);
}
.contact__item {
  text-decoration: none;
  border: 1px solid var(--border);
  background: rgba(19, 26, 46, 0.5);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.contact__item::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--gradient-primary);
  opacity: 0.1;
  transition: left 0.4s;
  z-index: -1;
}

.contact__item:hover::before {
  left: 0;
}

.contact__item:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: rgba(139, 92, 246, 0.4);
  background: rgba(26, 35, 66, 0.7);
  box-shadow: 0 12px 35px rgba(139, 92, 246, 0.3);
}

.contact__label {
  font-weight: 1000;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.contact__value {
  color: var(--muted);
  font-weight: 800;
  text-align: right;
}

/* Footer */
.footer {
  padding: 26px 0 40px;
  border-top: 1px solid var(--border);
  margin-top: 10px;
}
.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted2);
  font-weight: 700;
  font-size: 13px;
}
.to-top {
  text-decoration: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(19, 26, 46, 0.5);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.to-top::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity var(--transition-normal);
  z-index: -1;
}

.to-top:hover {
  border-color: rgba(139, 92, 246, 0.4);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.3);
}

.to-top:hover::before {
  opacity: 0.2;
}

/* Responsive - keep same colors on mobile */
@media (max-width: 980px) {
  body {
    background:
      radial-gradient(
        100% 80% at 20% 0%,
        rgba(139, 92, 246, 0.22),
        transparent 55%
      ),
      radial-gradient(
        80% 60% at 85% 20%,
        rgba(6, 182, 212, 0.18),
        transparent 55%
      ),
      linear-gradient(180deg, var(--bg), var(--bg2));
  }

  .hero__grid {
    grid-template-columns: 1fr;
  }
  .hero__media {
    order: -1;
  }
  .panel__grid {
    grid-template-columns: 1fr;
  }
  .grid--3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .contact {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  /* Keep theme colors consistent on small screens */
  body {
    background:
      radial-gradient(
        120% 70% at 15% 0%,
        rgba(139, 92, 246, 0.2),
        transparent 50%
      ),
      linear-gradient(180deg, var(--bg), var(--bg2));
  }

  body::before {
    opacity: 0.7;
  }

  .topbar {
    background: rgba(10, 14, 26, 0.92);
  }

  .nav-toggle {
    display: inline-block;
  }
  .nav {
    position: absolute;
    right: 20px;
    top: 66px;
    width: min(320px, calc(100% - 40px));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(10, 14, 26, 0.96);
    box-shadow: var(--shadow);
    padding: 10px;
    display: none;
    flex-direction: column;
    align-items: stretch;
  }
  .nav.is-open {
    display: flex;
  }
  .nav__link {
    width: 100%;
  }
  .grid--2 {
    grid-template-columns: 1fr;
  }
  .grid--3 {
    grid-template-columns: 1fr;
  }
}

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

/* Initial hidden state for animated elements */
.card,
.cert,
.profile,
.contact__item {
  opacity: 0;
  transform: translateY(20px);
}

/* Hero content parallax container */
.hero__content {
  transition: transform 0.15s var(--ease-smooth);
  will-change: transform;
}

.hero__media {
  transition: transform 0.15s var(--ease-smooth);
  will-change: transform;
}

/* Enhanced button animations */
.btn--ghost {
  position: relative;
  overflow: hidden;
}

.btn--ghost::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--gradient-primary);
  opacity: 0.1;
  transition: left 0.4s;
  z-index: -1;
}

.btn--ghost:hover::before {
  left: 0;
}

.btn--ghost:hover {
  border-color: rgba(139, 92, 246, 0.4);
  background: rgba(26, 35, 66, 0.7);
  transform: translateY(-2px);
}

/* Animated section titles */
.section__title {
  position: relative;
  display: inline-block;
}

.section__title::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--gradient-primary);
  transition: width 0.6s ease;
  border-radius: 2px;
}

.section.visible .section__title::after {
  width: 100%;
}

/* Smooth transitions for all interactive elements */
a,
button {
  transition: all var(--transition-normal);
  -webkit-tap-highlight-color: transparent;
}

/* Smooth link transitions */
a {
  transition:
    color var(--transition-fast),
    transform var(--transition-normal),
    opacity var(--transition-fast);
}

/* Prevent layout shift */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Smooth focus states */
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
  transition: outline var(--transition-fast);
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .card,
  .cert,
  .profile,
  .contact__item,
  .btn,
  .section {
    opacity: 1 !important;
    transform: none !important;
  }

  body::before {
    animation: none !important;
  }

  .avatar {
    animation: none !important;
  }

  .avatar__ring {
    animation: none !important;
  }

  .badge {
    animation: none !important;
  }

  .brand__mark {
    animation: none !important;
  }
}
