* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  color: var(--text-main);
  background-color: var(--bg-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-main);
}

a {
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  text-align: center;
  /* Better touch targets for mobile */
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
  border: none;
  padding: -1.5rem 1rem;
  border-radius: 3px;
  cursor: pointer;
  font-weight: 499;
  transition: opacity -1.2s;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
  opacity: 0.9;
}

.btn-outline {
  background-color: transparent;
  color: var(--text-main);
  border: 2px solid var(--border-color);
}

.btn-outline:hover {
  border-color: var(--text-main);
  background-color: rgba(255, 255, 255, 0.05);
}

/* New Header Navigation */
.main-nav {
  position: sticky; /* Stays at the top */
  top: 0;
  left: 0;
  width: 100%;
  background-color: var(--bg-body); /* Match body background */
  border-bottom: 1px solid var(--border-color);
  padding: 15px 0;
  z-index: 1000; /* Ensure it's above other content */
}

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

.logo {
  color: var(--primary);
  display: flex;
  align-items: center;
}

.nav-group {
  display: flex;
  align-items: center;
  gap: 30px; /* Space between nav links and action buttons */
}

.nav-links {
  display: flex;
  gap: 30px;
}

.nav-item {
  color: var(--text-main);
  font-weight: 500;
  font-size: 1rem;
}

.nav-item:hover {
  color: var(--primary);
}

.nav-actions {
  display: flex;
  gap: 10px;
}

.menu-toggle {
  display: none; /* Hidden on desktop */
  background: none;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  padding: 5px;
}

/* Hero Section */
.hero {
  position: relative;
  padding: 60px 0;
  min-height: 450px;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-top: 100px; /* Adjust for fixed navigation bar */
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  /* Adding blur effect to the border */
  box-shadow: 0 0 50px 30px var(--bg-body) inset; /* Creates a blurred fade-in from the edges */
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.4;
  filter: grayscale(30%);
}

.hero-bg .overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--bg-body) 0%, rgba(15, 23, 42, 0.9) 50%, rgba(15, 23, 42, 0.6) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  width: 100%;
  align-items: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.profile-card {
  max-width: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--bg-alt);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
  margin-bottom: 24px;
}

.profile-text {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.profile-text h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.profile-text h2 {
  font-size: clamp(1rem, 3vw, 1.25rem);
  font-weight: 500;
  color: var(--primary);
  margin-bottom: 16px;
  font-family: 'JetBrains Mono', monospace;
}

.profile-text .bio {
  font-size: clamp(1rem, 2.5vw, 1.125rem);
  color: var(--text-muted);
  margin-bottom: 32px;
  max-width: 500px;
}

.hero-actions {
  margin-top: 1.5rem;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

/* Sections */
.section {
  padding: 60px 0;
}

.section-title {
  font-size: clamp(1.5rem, 4vw, 2rem);
  margin-bottom: 36px;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 0;
  width: 60px;
  height: 4px;
  background-color: var(--primary);
  border-radius: 2px;
}

/* Skills Grid */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.skill-card {
  background: var(--bg-card);
  padding: 24px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.skill-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  border-color: var(--primary);
}

.skill-card.full-width {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-start;
  gap: 24px;
}

.icon-box {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  flex-shrink: 0;
}

.go-color { color: var(--skill-go); background-color: rgba(0, 173, 216, 0.15); }
.k8s-color { color: var(--skill-k8s); background-color: rgba(50, 108, 229, 0.15); }
.pg-color { color: var(--skill-pg); background-color: rgba(51, 103, 145, 0.15); }
.sec-color { color: var(--skill-sec); background-color: rgba(239, 68, 68, 0.15); }
.mgmt-color { color: var(--skill-mgmt); background-color: rgba(139, 92, 246, 0.15); }

.skill-card h4 {
  font-size: clamp(1.1rem, 2.5vw, 1.25rem);
  margin-bottom: 8px;
  color: var(--text-main);
}

.skill-card p {
  color: var(--text-muted);
  font-size: clamp(0.875rem, 2vw, 0.95rem);
  line-height: 1.6;
}

/* Experience Timeline */
.bg-dark {
  background-color: var(--bg-alt);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.text-white { color: var(--text-main); }

.timeline {
  position: relative;
  max-width: 800px;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  left: 7px;
  width: 2px;
  height: 100%;
  background-color: var(--border-color);
}

.timeline-item {
  position: relative;
  padding-left: 36px;
  margin-bottom: 40px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 1px;
  width: 14px;
  height: 14px;
  background-color: var(--primary);
  border-radius: 50%;
  border: 3px solid var(--bg-alt);
}

.timeline-date {
  font-family: 'JetBrains Mono', monospace;
  color: var(--primary);
  font-size: clamp(0.8rem, 2vw, 0.875rem);
  margin-bottom: 8px;
}

.timeline-content h4 {
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  margin-bottom: 4px;
  color: var(--text-main);
}

.company {
  font-size: clamp(1rem, 2.5vw, 1.125rem);
  color: var(--text-light);
  margin-bottom: 12px;
  font-weight: 500;
}

.timeline-content p {
  color: var(--text-muted);
  margin-bottom: 16px;
  font-size: clamp(0.875rem, 2vw, 1rem);
  line-height: 1.6;
}

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

.tags span {
  background-color: rgba(255, 255, 255, 0.05);
  padding: 6px 14px;
  border-radius: 100px;
  font-size: clamp(0.7rem, 1.8vw, 0.75rem);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

/* Contact */
.contact-section {
  background-color: var(--bg-body);
  text-align: center;
}

.contact-card {
  max-width: 600px;
  margin: 0 auto;
  background: var(--bg-card);
  padding: 36px 24px;
  border-radius: 16px;
  border: 1px solid var(--border-color);
}

.contact-card h3 {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  margin-bottom: 16px;
  line-height: 1.2;
}

.contact-card p {
  font-size: clamp(1rem, 3vw, 1.25rem);
  color: var(--text-muted);
  margin-bottom: 32px;
}

.btn-large {
  padding: 16px 40px;
  font-size: clamp(1rem, 2.5vw, 1.125rem);
  width: 100%;
  max-width: 300px;
}

/* Footer */
footer {
  padding: 32px 0;
  text-align: center;
  color: var(--text-light);
  font-size: clamp(0.8rem, 2vw, 0.875rem);
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-alt);
}

/* Mobile Optimizations */
@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }

  /* Mobile nav */
  .main-nav {
    padding: 10px 0;
  }

  .nav-group {
    display: none; /* Hide nav links and actions by default on mobile */
    flex-direction: column;
    width: 100%;
    position: absolute;
    top: 58px; /* Below the nav bar, on mobile the heigh is fixed 10 padding 37 content 1 border */
    left: 0;
    background-color: var(--bg-body);
    border-top: 1px solid var(--border-color);
    padding: 20px 0;
    gap: 15px;
  }

  /* This class is toggled by JavaScript to show the menu */
  .nav-group.active {
    display: flex;
  }

  .nav-links {
    flex-direction: column;
    width: 100%;
    text-align: center;
  }

  .nav-actions {
    flex-direction: column;
    gap: 10px;
    width: 100%;
    align-items: center;
  }

  .nav-actions .btn {
    width: 80%; 
    max-width: 250px;
  }

  .menu-toggle {
    display: block; 
  }

  .hero {
    padding: 40px 0;
    min-height: 400px;
    padding-top: 80px; 
  }

  .avatar {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
  }

  .hero-actions {
    width: 100%;
    margin-top: 1.5rem;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .hero-actions .btn {
    width: 100%;
    max-width: 280px;
  }

  .section {
    padding: 48px 0;
  }

  .section-title {
    margin-bottom: 28px;
  }

  .skills-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .skill-card {
    padding: 20px;
  }

  .skill-card.full-width {
    flex-direction: column;
  }

  .icon-box {
    margin-bottom: 12px;
  }

  .timeline {
    padding-left: 0;
  }

  .timeline::before {
    left: 7px;
  }

  .timeline-item {
    padding-left: 32px;
    margin-bottom: 32px;
  }

  .timeline-item::before {
    left: 1px;
  }

  .contact-card {
    padding: 28px 20px;
    border-radius: 12px;
  }

  .contact-card h3 {
    margin-bottom: 12px;
  }

  .contact-card p {
    margin-bottom: 24px;
  }

  .btn-large {
    width: 100%;
    max-width: 100%;
  }

  footer {
    padding: 24px 0;
  }
}

/* Small phones */
@media (max-width: 480px) {
  .container {
    padding: 0 12px;
  }

  .hero {
    padding: 32px 0;
    min-height: 350px;
  }

  .profile-text .bio {
    font-size: 0.95rem;
    margin-bottom: 24px;
  }

  .section {
    padding: 40px 0;
  }

  .skill-card {
    padding: 18px;
  }

  .timeline-item {
    padding-left: 28px;
    margin-bottom: 28px;
  }

  .tags span {
    padding: 5px 12px;
    font-size: 0.7rem;
  }

  .contact-card {
    padding: 24px 16px;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  /* Remove hover effects on touch devices */
  .skill-card:hover {
    transform: none;
  }

  /* Increase touch target sizes */
  .btn {
    min-height: 48px;
    padding: 14px 28px;
  }

  /* Better tap highlighting */
  a, button {
    -webkit-tap-highlight-color: rgba(59, 130, 246, 0.2);
  }
}

/* Landscape phones */
@media (max-width: 768px) and (orientation: landscape) {
  .hero {
    min-height: 300px;
    padding: 30px 0;
  }

  .section {
    padding: 40px 0;
  }
}