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

:root {
  --primary: #1a1a1a;
  --secondary: #444;
  --tertiary: #666;
  --border: #e5e5e5;
  --border-dark: #d0d0d0;
  --bg-main: #fafafa;
  --bg-card: #fff;
  --bg-subtle: #f5f5f5;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  color: var(--primary);
  background: var(--bg-main);
  padding: 2rem;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  position: relative; /* Ensure absolute positioning works inside */
  border-radius: 16px;
  overflow: hidden; /* Clip header and footer corners */
}

/* Language Switcher */
.language-switcher {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Language Toggle Buttons */
.lang-toggle {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.lang-btn {
  padding: 6px 12px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lang-btn:hover {
  background: var(--bg-main);
  color: var(--text-primary);
}

.lang-btn.active {
  background: var(--primary);
  color: white;
}

/* Hide Google Translate dropdown */
.google-translate-hidden {
  display: none;
}

/* Customize Google Translate Dropdown */
.goog-te-gadget {
  font-family: inherit !important;
  color: transparent !important; /* Hide text "Powered by Google" */
  font-size: 0 !important;
}

.goog-te-combo {
  display: inline-block !important; /* Force visibility */
  margin: 0 !important;
  padding: 6px 10px !important;
  border-radius: 8px !important;
  border: 1px solid var(--border) !important;
  background: var(--bg-card) !important;
  color: var(--primary) !important;
  font-family: inherit !important;
  font-size: 0.875rem !important;
  cursor: pointer !important;
  outline: none !important;
  box-shadow: var(--shadow-sm) !important;
  transition: all 0.2s;
  height: auto !important;
  line-height: 1.5 !important;
  vertical-align: middle;
}

.goog-te-combo:hover {
  border-color: var(--border-dark) !important;
  background-color: var(--bg-main) !important;
}

/* Hide Google Icon/Branding */
.goog-logo-link {
  display: none !important;
}

.goog-te-gadget > span {
  display: none !important;
}

/* Ensure container doesn't block clicks */
#google_element {
  /* min-height: 40px; */
  display: inline-block;
}

/* Clean up top banner and other artifacts */
.skiptranslate iframe,
.goog-te-banner-frame {
  display: none !important;
}

body {
  top: 0px !important;
}

#goog-gt-tt,
.goog-te-balloon-frame {
  display: none !important;
}

.goog-text-highlight {
  background: none !important;
  box-shadow: none !important;
}

/* Header Styles */
header {
  padding: 3.5rem 3rem 2.5rem;
  border-bottom: 2px solid var(--primary);
  background: var(--bg-card);
  position: relative;
}

.header-content {
  display: flex;
  align-items: stretch; /* Stretch children to same height */
  gap: 2rem;
  margin-bottom: 1.5rem;
  padding-top: 2.5rem;
}

.profile-img {
  width: 140px; /* Slightly larger to be safe or keep 120? User said "same height" */
  height: 140px; /* Let's bump to 140 to give text breathing room if we space-between */
  /* Wait, if I increase image, text needs more space. Let's keep 120 and compress text margin */
  width: 130px;
  height: 130px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--bg-main);
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
}

.header-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* Force top and bottom alignment */
  padding: 0.25rem 0; /* Slight padding to align visually with round edges */
  height: 130px; /* Match image height */
}

.header-text h1 {
  font-size: 2rem; /* Reduced further */
  font-weight: 700;
  margin-bottom: 0; /* Handled by space-between */
  letter-spacing: -0.02em;
  color: #000;
  line-height: 1.1;
}

.subtitle {
  font-size: 1.125rem;
  color: var(--secondary);
  font-weight: 500;
  margin-bottom: 0; /* Handled by space-between */
}

.subtitle {
  font-size: 1.25rem;
  color: var(--tertiary);
  font-weight: 400;
}

.header-contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.contact-chip {
  display: inline-flex;
  align-items: center;
  /* gap: 0.5rem; Removed to fix centering when collapsed */
  padding: 0.5rem 0.6rem;
  border-radius: 9999px; /* Pill shape */
  text-decoration: none;
  color: var(--secondary);
  background: var(--bg-main);
  border: 1px solid var(--border);
  transition: all 0.3s ease;
  font-size: 0.875rem;
  height: 36px;
}

.contact-chip:hover {
  border-color: var(--border-dark);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  color: var(--primary);
}

.contact-icon {
  width: 18px;
  height: 18px;
  stroke: var(--tertiary);
  flex-shrink: 0;
}

.contact-chip:hover .contact-icon {
  stroke: var(--primary);
}

/* Email Chip - Always visible text */
.email-chip .contact-text {
  display: inline-block;
  margin-left: 0.5rem; /* Static margin */
}

/* Social Chips - Animated Text */
.social-chip .slide-text {
  max-width: 0;
  opacity: 0;
  margin-left: 0; /* No margin when collapsed */
  overflow: hidden;
  white-space: nowrap;
  transition: max-width 0.4s ease, opacity 0.3s ease, margin-left 0.4s ease;
}

.social-chip:hover .slide-text {
  max-width: 200px; /* Arbitrary large enough width */
  opacity: 1;
  margin-left: 0.5rem; /* Add spacing on hover */
}

/* Main Content */
main {
  padding: 3rem;
}

section {
  margin-bottom: 4rem;
}

section:last-child {
  margin-bottom: 0;
}

.section-header {
  display: flex;
  align-items: center;
  margin-bottom: 2.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.section-number {
  font-size: 0.875rem;
  font-weight: 600;
  color: #999;
  margin-right: 1rem;
  font-family: "Courier New", monospace;
}

.section-header h2 {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #000;
}

.summary-box {
  background: var(--bg-subtle);
  border-left: 4px solid var(--primary);
  padding: 2rem;
  margin-bottom: 3rem;
  line-height: 1.8;
  color: #333;
  position: relative;
}

/* Card Styles */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 2rem;
  margin-bottom: 1.5rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: visible; /* Allow SVG border to show */
  border-radius: 12px;
}

/* SVG Border Animation */
.card-border {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: visible; /* Prevent clipping of border paths */
}

.skill-border {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: visible;
}

.card-border path,
.skill-border path {
  fill: none;
  stroke: var(--primary);
  stroke-width: 0.5;
  vector-effect: non-scaling-stroke;
}

/* Left border on hover - matches experience card style */
.card:hover {
  border-left: 3px solid var(--primary);
  box-shadow: var(--shadow-md);
  stroke-linecap: square;
}

.card:last-child {
  margin-bottom: 0;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 1rem;
  gap: 1rem;
}

.card-title {
  flex: 1;
}

.card-title h3 {
  font-size: 1.375rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
  color: #000;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.project-icon {
  width: 24px;
  height: 24px;
  stroke: var(--primary);
}

.card-subtitle {
  font-size: 0.9375rem;
  color: var(--tertiary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.type-icon {
  width: 16px;
  height: 16px;
  stroke: var(--tertiary);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.875rem;
  background: var(--bg-card);
  border: 1px solid var(--border-dark);
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--tertiary);
  white-space: nowrap;
}

.calendar-icon {
  width: 14px;
  height: 14px;
  stroke: var(--tertiary);
}

.card-description {
  color: var(--secondary);
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.tech-tag {
  font-size: 0.8125rem;
  padding: 0.5rem 0.875rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: #555;
  font-family: "Courier New", monospace;
  transition: all 0.2s;
  border-radius: 8px;
}

.tech-tag:hover {
  background: var(--bg-card);
  border-color: var(--border-dark);
}

.card-footer {
  display: flex;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  transition: all 0.2s;
  border-radius: 8px;
}

.card-link:hover {
  background: var(--bg-main);
  border-color: var(--primary);
}

.link-icon {
  width: 16px;
  height: 16px;
  stroke: var(--primary);
}

/* Experience Styles */
.experience-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  padding: 2rem;
  margin-bottom: 1.5rem;
  transition: all 0.2s;
  border-radius: 12px;
}

.experience-card:hover {
  box-shadow: var(--shadow-sm);
}

.experience-card:last-child {
  margin-bottom: 0;
}

.experience-header {
  margin-bottom: 1rem;
}

.experience-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #000;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.briefcase-icon {
  width: 20px;
  height: 20px;
  stroke: var(--primary);
}

.experience-meta {
  display: flex;
  gap: 1.5rem;
  font-size: 0.875rem;
  color: var(--tertiary);
  margin-bottom: 0.5rem;
}

.experience-company {
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.experience-period {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #999;
}

.meta-icon {
  width: 14px;
  height: 14px;
  stroke: currentColor;
}

.experience-description {
  color: var(--secondary);
  line-height: 1.7;
}

/* Skills Styles */
.skills-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.skill-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 1.75rem;
  transition: all 0.2s;
  border-radius: 12px;
  position: relative; /* For absolute SVG */
  overflow: visible; /* Allow border to sit on edge without clipping */
}

.skill-box:hover {
  border-color: var(--border-dark);
  box-shadow: var(--shadow-sm);
}

.skill-box h3 {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #000;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.skill-icon {
  width: 18px;
  height: 18px;
  stroke: var(--primary);
}

.skill-box ul {
  list-style: none;
}

.skill-box li {
  font-size: 0.9375rem;
  color: #555;
  margin-bottom: 0.75rem;
  padding-left: 0;
  position: relative;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.skill-item-icon {
  width: 16px;
  height: 16px;
  border-radius: 4px;
}

.skill-box li:hover {
  color: var(--primary);
}

/* Footer */
footer {
  padding: 2rem 3rem;
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  color: #999;
}

.footer-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-icon {
  width: 16px;
  height: 16px;
  stroke: #999;
}

/* Responsive */
@media (max-width: 768px) {
  body {
    padding: 0;
  }

  .container {
    box-shadow: none;
    border: none;
  }

  header,
  main,
  footer {
    padding: 2rem 1.5rem;
  }

  /* Add top padding to header for language switcher */
  header {
    padding-top: 3.5rem;
  }

  /* Language Switcher - Mobile - Keep on right */
  .language-switcher {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    justify-content: flex-end;
  }

  .lang-btn {
    padding: 5px 10px;
    font-size: 0.7rem;
  }

  .goog-te-combo {
    font-size: 0.75rem !important;
    padding: 5px 8px !important;
  }

  /* Profile Image - Smaller on mobile */
  .profile-img {
    width: 100px;
    height: 100px;
  }

  /* Header - Flex column with items center */
  .header-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
  }

  .header-text {
    align-items: center;
    height: auto;
    justify-content: center;
    gap: 0.5rem;
  }

  /* Name - Smaller on mobile */
  .header-text h1 {
    font-size: 1.5rem;
  }

  /* Title - Smaller on mobile */
  .subtitle {
    font-size: 1rem;
  }

  .header-contacts {
    justify-content: center;
  }

  .contact-chip {
    padding: 0.4rem 0.5rem;
    font-size: 0.8rem;
    height: 32px;
  }

  .contact-icon {
    width: 16px;
    height: 16px;
  }

  /* Section headers smaller */
  .section-header h2 {
    font-size: 1.375rem;
  }

  .card-header {
    flex-direction: column;
  }

  .badge {
    align-self: flex-start;
  }

  .experience-meta {
    flex-direction: column;
    gap: 0.5rem;
  }

  footer {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

/* Small mobile - even smaller */
@media (max-width: 480px) {
  header,
  main,
  footer {
    padding: 1.5rem 1rem;
  }

  .language-switcher {
    padding: 0.75rem 1rem 0;
    gap: 0.35rem;
  }

  .lang-btn {
    padding: 4px 8px;
    font-size: 0.65rem;
  }

  .goog-te-combo {
    font-size: 0.7rem !important;
    padding: 4px 6px !important;
  }

  .profile-img {
    width: 90px;
    height: 90px;
  }

  .header-text h1 {
    font-size: 1.25rem;
  }

  .subtitle {
    font-size: 0.875rem;
  }

  .section-header h2 {
    font-size: 1.25rem;
  }

  .card-title h3 {
    font-size: 1.125rem;
  }

  .summary-box {
    padding: 1.25rem;
  }

  .card,
  .experience-card,
  .skill-box {
    padding: 1.25rem;
  }
}
