/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  /* MODIFIED: Use Inter for body text (fallback to Arial) */
  font-family: 'Inter', Arial, sans-serif;
  /* MODIFIED: Changed background from white (#fff) to #FAFAFA for light theme */
  background: #FAFAFA; /* Light off-white background */
  transition: background-color 0.4s ease, color 0.4s ease; /* Add transition */
  /* iPhone safe areas (notch + home bar) */
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  /* Prevent horizontal overflow on mobile */
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

/* MODIFIED: Use Space Grotesk for all headings (titles) */
/* MODIFIED: Replaced Space Grotesk with Poppins for all headings (titles) */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Poppins', Arial, sans-serif;
}

/* Smooth scrolling behavior */
html {
  scroll-behavior: smooth;
}

/* Global paragraph spacing (20–24px range) */
p {
  margin-bottom: 22px;
}

/* Navbar container */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.1); /* Glass effect with white */
  backdrop-filter: blur(10px); /* Glass blur effect */
  padding: 14px 20px;
  position: fixed;
  top: 0;
  left: 0;
  width: calc(100% - 20px); /* Adjust width to account for margin */
  z-index: 1000;
  border-radius: 32px; /* Makes the navbar corners rounded */
  margin: 10px; /* Adds space around navbar so rounded corners are visible */
  /* MODIFIED: Added black outline for light theme navbar background */
  border: 2px solid rgba(0, 0, 0, 0.2); /* Semi-transparent border for glass effect */
}

/* Spacer to push menu to the right */
.spacer {
  flex: 1;
}

.navbar .logo {
  color: white;
  font-size: 20px;
  font-weight: bold;
}

.navbar .logo img {
  height: 32px;      /* Adjust logo height */
  vertical-align: middle;
}

.navbar .menu {
  display: flex;
  gap: 20px;
}

.navbar .menu a {
  color: black;
  text-decoration: none;
  font-size: 16px;
  padding: 8px 12px;
  border-radius: 999px; /* Add this line for always-oval shape */
  transition: background-color 0.3s; /* Only animate color */
}

.navbar .menu a:hover {
  background-color: red;      /* Changes background to red on hover */
  border-radius: 999px;       /* Makes the background fully oval/pill-shaped */
  transition: background-color 0.3s, border-radius 0.3s; /* Smooth transition for color and shape */
}

.navbar .menu a.active {
  background-color: red;      /* Keeps background red when active/selected */
  border-radius: 999px;       /* Keeps the oval shape when active */
}

/* Hamburger icon (hidden on desktop) */
.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
}

.hamburger div {
  width: 25px;
  height: 3px;
  background-color: #333;
  margin: 4px 0;
  transition: background-color 0.4s ease;
}

body.dark-mode .hamburger div {
  background-color: #EDEDED;
}

/* Responsive: mobile navbar */
@media (max-width: 768px) {
  .navbar {
    padding: 10px 16px;
  }

  .navbar .menu {
    display: none;
    position: absolute;
    top: 50px;
    left: 0;
    right: 0;
    flex-direction: column;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    width: 100%;
    border-radius: 0 0 16px 16px;
    padding: 12px 0;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  }

  .navbar .menu a {
    padding: 12px 20px;
    font-size: 1rem;
  }

  /* Hide desktop toggle, show in-menu toggle on mobile */
  .theme-toggle-desktop {
    display: none !important;
  }
  .lang-toggle-desktop {
    display: none !important;
  }
  .navbar .menu .theme-toggle-menu {
    display: block;
    margin: 12px auto 4px;
    padding: 10px 20px;
    font-size: 24px;
    color: #333;
    background: none;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 999px;
    cursor: pointer;
    width: fit-content;
  }
  .navbar .menu .lang-toggle-menu {
    display: block;
    margin: 8px auto 4px;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    background: none;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 999px;
    cursor: pointer;
    width: fit-content;
    letter-spacing: 0.5px;
  }
  body.dark-mode .navbar .menu .theme-toggle-menu {
    color: #EDEDED;
    border-color: rgba(255, 255, 255, 0.15);
  }
  body.dark-mode .navbar .menu .lang-toggle-menu {
    color: #EDEDED;
    border-color: rgba(255, 255, 255, 0.15);
  }

  body.dark-mode .navbar .menu {
    background-color: rgba(30, 30, 30, 0.95);
  }

  .navbar .menu.active {
    display: flex;
  }

  .hamburger {
    display: flex;
  }
}

/* Footer styling */
footer {
  background: #f1f1f1;
  padding: 20px;
  text-align: center;
  color: #555;
  margin-top: 50px;
}

/* Theme toggle button styling */
.theme-toggle {
  /* MODIFIED: Added Inter font for button */
  font-family: 'Inter', Arial, sans-serif;
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  margin-left: 10px;
}

/* Hide the in-menu toggle on desktop */
.theme-toggle-menu {
  display: none;
}

/* Language toggle button styling (desktop) */
.lang-toggle {
  font-family: 'Inter', Arial, sans-serif;
  background: none;
  border: 1px solid rgba(0, 0, 0, 0.2);
  color: #333;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-left: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.5px;
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

.lang-toggle:hover {
  background-color: red;
  color: #fff;
  border-color: red;
}

body.dark-mode .lang-toggle {
  color: #EDEDED;
  border-color: rgba(255, 255, 255, 0.2);
}

body.dark-mode .lang-toggle:hover {
  background-color: red;
  color: #fff;
  border-color: red;
}

/* Hide the in-menu language toggle on desktop */
.lang-toggle-menu {
  display: none;
}

/* Body dark mode */
body.dark-mode {
  /* MODIFIED: Changed background from #121212 to #0B0D10 (deep neutral) for dark theme */
  background-color: #0B0D10;
  /* MODIFIED: Use slightly lighter text color in dark mode for better contrast */
  color: #EDEDED;
}

/* Navbar dark mode override */
body.dark-mode .navbar {
  /* MODIFIED: Changed background to transparent rgba for consistency with light theme */
  background-color: rgba(30, 30, 30, 0.2); /* Glass effect with dark background */
  backdrop-filter: blur(10px); /* Glass blur effect */
  /* MODIFIED: Thinner border and subtle shadow for dark theme */
  border: 1px solid rgba(255, 59, 63, 0.2);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.15);
}

/* Menu dark mode override */
body.dark-mode .navbar .menu a {
  /* MODIFIED: Use #EDEDED for menu item text in dark mode */
  color: #EDEDED;
}

body.dark-mode .navbar .menu a:hover,
body.dark-mode .navbar .menu a.active {
  background-color: red;
  border-radius: 999px;
}

/* Footer dark mode */
body.dark-mode footer {
  background-color: #1e1e1e;
  /* MODIFIED: Use #EDEDED for footer text in dark mode */
  color: #EDEDED;
}

/* Hero Section Dark Mode */
body.dark-mode .hero {
  background: #181818;
}

body.dark-mode .hero-text h1,
body.dark-mode .hero-text p {
  /* MODIFIED: Use #EDEDED for hero text in dark mode */
  color: #EDEDED;
}

body.dark-mode .hero-image img {
  /* MODIFIED: Hide shadow in dark mode */
  box-shadow: none;
}

/* About Me Section Dark Mode */
body.dark-mode .about-me {
  background: #181818;
}

body.dark-mode .about-avatar img {
  /* MODIFIED: Add light border around avatar in dark mode (matches button color) */
  border: 2px solid #ff3b3f;
  /* MODIFIED: Hide shadow in dark mode */
  box-shadow: none;
}

body.dark-mode .about-info h2,
body.dark-mode .about-info h3,
body.dark-mode .about-info p {
  /* MODIFIED: Use #EDEDED for about section text in dark mode */
  color: #EDEDED;
}

/* Skills Cards Dark Mode */
body.dark-mode .skill-card {
  background: #232323;
}

body.dark-mode .skill-group h4 {
  color: #EDEDED;
}

body.dark-mode .skill-group p {
  color: #B0B0B0;
}

/* Portfolio Section Dark Mode */
body.dark-mode .portfolio {
  background: #181818;
}

body.dark-mode .portfolio-container h2,
body.dark-mode .portfolio-card h3,
body.dark-mode .portfolio-card p {
  /* MODIFIED: Use #EDEDED for portfolio section text in dark mode */
  color: #EDEDED;
}

body.dark-mode .portfolio-card {
  background: #232323;
}

/* Services Section Dark Mode */
body.dark-mode .services {
  background: #181818;
}

body.dark-mode .services-container h2,
body.dark-mode .services-card h3,
body.dark-mode .services-card p {
  /* MODIFIED: Use #EDEDED for services section text in dark mode */
  color: #EDEDED;
}

body.dark-mode .services-card {
  background: #232323;
}

/* Contact Section Dark Mode */
body.dark-mode .contact {
  background: #181818;
}

body.dark-mode .contact-container h2,
body.dark-mode .contact-info p,
body.dark-mode .contact-item,
body.dark-mode .contact-form input,
body.dark-mode .contact-form textarea {
  /* MODIFIED: Use #EDEDED for contact section text in dark mode */
  color: #EDEDED;
}

body.dark-mode .contact-form {
  background: #232323;
}

body.dark-mode .contact-form input,
body.dark-mode .contact-form textarea {
  background: #181818;
  border-color: #333;
}

body.dark-mode .contact-form input:focus,
body.dark-mode .contact-form textarea:focus {
  background: #232323;
  border-color: #6ea0d1;
}

/* MODIFIED: Set button text color to #FAFAFA for dark mode */
body.dark-mode .cta-btn,
body.dark-mode .contact-form button.cta-btn {
  color: #FAFAFA;
}

/* Portfolio Visit Website Button with navbar glass effect */
.portfolio-card .visit-btn {
  background: transparent;
  padding: 8px 16px;
  font-size: 0.875rem;
  display: inline-block;
  border: 2px solid rgba(0, 0, 0, 0.2); /* Light theme border */
  transition: border-color 0.4s ease, background 0.2s ease;
}

body.dark-mode .portfolio-card .visit-btn {
  border: 2px solid rgba(255, 59, 63, 0.3); /* Dark theme red border */
}

/* Smooth transitions for navbar and footer elements too */
.navbar,
.navbar .menu a,
footer {
  transition: background-color 0.4s ease, color 0.4s ease;
}

/* Hero Section Styles */
.hero {
  min-height: 100vh;          /* Fill at least the viewport, grow if text is longer */
  margin-top: 0;              /* Remove extra space above */
  margin-bottom: 0;           /* Remove extra space below */
  padding: 110px 20px 20px;   /* Top padding clears the fixed navbar */
  background: #fff; /* White background */
  display: flex;
  justify-content: center;
  /* Removed align-items:center — use margin:auto on child instead */
}

.hero-content {
  display: flex;
  flex-wrap: wrap;
  max-width: 1920px;
  width: 90%;
  align-items: center;
  gap: 120px;
  margin: auto 0; /* Vertically center when space allows, stay at top when content overflows */
}

.hero-text {
  flex: 1 1 300px;
}

.hero-text h1 {
  font-size: clamp(2.5rem, 4vw, 3.5rem);
  line-height: 1.15;
  max-width: 640px;
  margin-bottom: 20px;
  color: #222;
  text-wrap: balance;
}

.hero-text p {
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  margin-top: 16px;
  margin-bottom: 32px;
  color: #555;
  opacity: 0.8;
}

.cta-btn {
  /* MODIFIED: Added Inter font for button */
  font-family: 'Inter', Arial, sans-serif;
  display: inline-block;
  background: #ff3b3f;
  /* MODIFIED: Set text color to #0B0D10 for light theme */
  color: #0B0D10;
  padding: 16px 36px;
  border-radius: 999px;
  font-size: 1.1rem;
  text-decoration: none;
  font-weight: bold;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
  transition: background 0.2s;
}

.cta-btn:hover {
  background: #d32f2f;
}

.hero-buttons {
  display: flex;
  gap: 20px;
  margin-top: 32px;
}

.cta-btn-secondary {
  background: transparent;
  border: 2px solid #ff3b3f;
  color: #ff3b3f;
  padding: 14px 32px;
  font-weight: 600;
}

.cta-btn-secondary:hover {
  background: #ff3b3f;
  color: #fff;
  box-shadow: 0 4px 16px rgba(255, 59, 63, 0.25);
}

body.dark-mode .cta-btn-secondary {
  color: #ff3b3f;
  border-color: #ff3b3f;
}

body.dark-mode .cta-btn-secondary:hover {
  background: #ff3b3f;
  color: #0B0D10;
}

.hero-image {
  flex: 1 1 600px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-image img {
  max-width: 1920px;
  width: 100%;
  border-radius: 24px;
  box-shadow: 16px 16px 40px rgba(0,0,0,0.55);
}

/* About Me Section Styles */
.about-me {
  background: #fff; /* White background */
  min-height: 100vh;           /* Make About Me fill the viewport */
  padding: 0 20px;             /* Remove top/bottom padding for a tighter fit */
  display: flex;
  justify-content: center;
  align-items: center;         /* Vertically center content */
}

.about-container {
  display: flex;
  align-items: center;
  max-width: 1920px;
  width: 90%;
  gap: 48px;
  flex-wrap: wrap;
}

.about-avatar {
  flex: 1 1 220px;
  display: flex;
  justify-content: flex-start; /* Allign avatar to the left */
  align-items: center;
  margin-left: -80px; /* Move avatar further left (adjust value as needed) */
}

.about-avatar img {
  width: 360px;
  height: 360px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 16px 16px 40px rgba(0,0,0,0.55);
  background: #fff;
}

.about-info {
  flex: 2 1 320px;
}

.about-info h2 {
  font-size: 2.2rem;
  margin-bottom: 16px;
  color: #222;
  text-wrap: balance;
}

.about-info p {
  font-size: 1.35rem;
  margin-bottom: 24px;
  color: #444;
  max-width: 900px;
  text-align: center;
}

.about-info h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
  color: #333;
}

.skills-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.skills-list li {
  background: #e3e7ea;
  color: #222;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 1rem;
  margin-bottom: 8px;
}

.skills-icons {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 12px;
  justify-content: center;
}

/* Skills grid: three categories */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-top: 12px;
}

.skill-group h4 {
  margin: 0 0 8px 0;
  font-size: 1rem;
  color: #333;
  text-align: center;
}

.skill-group p {
  margin: 0 0 12px 0;
  font-size: 0.95rem;
  color: #666;
  text-align: center;
}

.skill-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  padding: 28px 20px;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.skill-card .skills-icons {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.skill-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.skills-footer {
  text-align: center;
  font-size: 0.95rem;
  color: #666;
  margin: 24px auto 0;
  max-width: 600px;
}

body.dark-mode .skills-footer {
  color: #B0B0B0;
}

@media (max-width: 900px) {
  .skills-grid {
    grid-template-columns: 1fr;
  }
}

.skill-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  transition: transform 0.2s;
}

.skill-icon:hover {
  transform: scale(1.15);
}

/* Portfolio Section Styles */
.portfolio {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff; /* White background */
  padding: 0 20px;
}

.portfolio-container {
  width: 90%;
  max-width: 1920px;
  margin: 0 auto;
  text-align: center;
}

.portfolio-container h2 {
  font-size: 2.5rem;
  margin-bottom: 40px;
  color: #222;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 32px;
}

.portfolio-card {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.portfolio-card:hover {
  transform: translateY(-8px) scale(1.03);
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}

.portfolio-card img {
  width: 100%;
  max-width: 220px;
  height: 140px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 18px;
  background: #e3e7ea;
}

.portfolio-card h3 {
  margin: 0 0 10px 0;
  font-size: 1.2rem;
  color: #333;
}

.portfolio-media {
  position: relative;
  width: 100%;
  border-radius: 18px;
  overflow: hidden;
  margin-bottom: 18px;
  background: #e3e7ea;
}

.portfolio-media img {
  width: 100%;
  height: auto;
  max-width: none;
  object-fit: cover;
  display: block;
}

.portfolio-media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.portfolio-card:hover .portfolio-media video {
  opacity: 1;
}

.portfolio-button-wrapper {
  width: 100%;
  margin-top: 16px;
  display: flex;
  justify-content: center;
}

.portfolio-card p {
  color: #555;
  font-size: 1rem;
  margin: 0;
}

/* Services Section Styles */
.services {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff; /* White background */
  padding: 0 20px;
}

.services-container {
  width: 90%;
  max-width: 1920px;
  margin: 0 auto;
  text-align: center;
}

.services-container h2 {
  font-size: 2.5rem;
  margin-bottom: 40px;
  color: #222;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 32px;
}

.services-card {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.services-card:hover {
  transform: translateY(-8px) scale(1.03);
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}

.services-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 18px;
  background: #e3e7ea;
}

.services-card h3 {
  margin: 0 0 10px 0;
  font-size: 1.2rem;
  color: #333;
}

.services-card p {
  color: #555;
  font-size: 1rem;
  margin: 0;
}

/* Contact Section Styles */
.contact {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff; /* White background */
  padding: 0 20px;
}

.contact-container {
  width: 90%;
  max-width: 1920px;
  margin: 0 auto;
  text-align: center;
}

.contact-container h2 {
  font-size: 2.5rem;
  margin-bottom: 40px;
  color: #222;
}

.contact-inner {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  gap: 48px;
  align-items: center;
  justify-content: center;
  text-align: left;
}

.contact-info {
  flex: 1 1 320px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.contact-info p {
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  color: #555;
  opacity: 0.8;
  margin-top: 16px;
  margin-bottom: 32px;
}

.highlight-talk {
  font-weight: bold;
  color: #ff3b3f;
  opacity: 1;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.1rem;
  color: #333;
}

.contact-social {
  display: flex;
  gap: 28px;
  margin-top: 16px;
}

.contact-social .icon {
  width: 44px;
  height: 44px;
  transition: transform 0.2s;
}

.contact-social .icon:hover {
  transform: scale(1.15);
}

.icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.contact-form {
  flex: 1 1 340px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 1rem;
  background: #f9fafb;
  resize: none;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: #6ea0d1;
  background: #fff;
}

.contact-form button.cta-btn {
  /* MODIFIED: Added Inter font for button */
  font-family: 'Inter', Arial, sans-serif;
  align-self: flex-end;
  background: #ff3b3f;
  /* MODIFIED: Set text color to #0B0D10 for light theme */
  color: #0B0D10;
  padding: 12px 32px;
  border-radius: 999px;
  font-size: 1.1rem;
  font-weight: bold;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}

.contact-form button.cta-btn:hover {
  background: #d32f2f;
}

.form-response-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  z-index: 9999;
  padding: 20px;
}

.form-response-modal.active {
  display: flex;
}

.form-response-content {
  width: min(480px, 100%);
  background: #ffffff;
  color: #111111;
  border-radius: 18px;
  padding: 28px 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
  position: relative;
  text-align: center;
}

body.dark-mode .form-response-content {
  background: #111111;
  color: #f3f4f6;
}

.form-response-content h3 {
  margin: 0 0 12px;
  font-size: 1.25rem;
}

.form-response-content p {
  margin: 0;
  line-height: 1.6;
  font-size: 1rem;
}

.close-modal {
  position: absolute;
  top: 14px;
  right: 14px;
  border: none;
  background: transparent;
  color: inherit;
  font-size: 1.75rem;
  cursor: pointer;
  line-height: 1;
}

/* Responsive – Tablet & small desktop */
@media (max-width: 900px) {
  .hero-content {
    flex-direction: column-reverse;
    text-align: center;
    gap: 40px;
  }
  .hero-image {
    margin-bottom: 0;
  }
  .hero-buttons {
    justify-content: center;
  }
  .about-container {
    flex-direction: column;
    text-align: center;
    gap: 32px;
  }
  .about-avatar {
    margin-left: 0;
    justify-content: center;
  }
  .about-info {
    align-items: center;
  }
  .contact-inner {
    flex-direction: column;
    gap: 32px;
    text-align: center;
  }
  .contact-info {
    align-items: center;
  }
  .contact-form {
    align-items: center;
  }
}

/* Responsive – Mobile phones (iOS + Android) */
@media (max-width: 768px) {
  /* Offset anchors for fixed navbar */
  section[id] {
    scroll-margin-top: 70px;
  }

  /* ===== HERO ===== */
  .hero {
    /* Use min-height so section can grow for longer translations */
    min-height: 100vh;
    min-height: 100dvh; /* iOS Safari + modern Android */
    padding: 80px 16px 20px;
    padding-top: calc(80px + env(safe-area-inset-top));
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    justify-content: center;
  }
  .hero-content {
    gap: clamp(12px, 3vh, 28px);
    max-height: 100%;
  }
  .hero-text h1 {
    font-size: clamp(1.3rem, 5.5vw, 2.2rem);
    margin-bottom: clamp(6px, 1.5vh, 18px);
  }
  .hero-text p {
    font-size: clamp(0.9rem, 3.2vw, 1.2rem);
    margin-top: clamp(4px, 1vh, 8px);
    margin-bottom: clamp(8px, 2vh, 20px);
  }
  .hero-image {
    max-height: clamp(120px, 30vh, 280px);
    overflow: hidden;
  }
  .hero-image img {
    max-width: 100%;
    max-height: clamp(120px, 30vh, 280px);
    object-fit: cover;
    border-radius: 16px;
  }
  .hero-buttons {
    flex-direction: column;
    gap: 10px;
    align-items: center;
    margin-top: clamp(8px, 1.5vh, 16px);
  }
  .cta-btn {
    padding: 12px 24px;
    font-size: 0.95rem;
    width: 100%;
    max-width: 260px;
    text-align: center;
  }
  .cta-btn-secondary {
    padding: 10px 24px;
  }

  /* ===== ABOUT ===== */
  .about-me {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 48px 16px;
    padding-top: calc(48px + env(safe-area-inset-top));
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .about-container {
    max-width: 100%;
  }
  .about-avatar {
    margin-left: 0;
    justify-content: center;
  }
  .about-avatar img {
    width: clamp(140px, 30vw, 200px);
    height: clamp(140px, 30vw, 200px);
  }
  .about-info p {
    font-size: 1.05rem;
    max-width: 100%;
  }
  .about-info h2 {
    font-size: 1.8rem;
  }
  .skill-card {
    padding: 20px 16px 28px;
    min-height: auto;
  }

  /* ===== PORTFOLIO ===== */
  .portfolio {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 48px 16px 56px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: calc(48px + env(safe-area-inset-top));
  }
  .portfolio-container {
    max-width: 100%;
  }
  .portfolio-container h2 {
    font-size: 1.8rem;
    margin-bottom: 24px;
  }
  .portfolio-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .portfolio-card {
    padding-bottom: 28px;
  }
  .portfolio-card img,
  .portfolio-card video {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
  }

  /* ===== SERVICES ===== */
  .services {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 48px 16px 56px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: calc(48px + env(safe-area-inset-top));
  }
  .services-container {
    max-width: 100%;
  }
  .services-container h2 {
    font-size: 1.8rem;
    margin-bottom: 24px;
  }
  .services-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .services-card {
    padding-bottom: 28px;
  }
  .services-card img {
    height: 160px;
  }

  /* ===== CONTACT ===== */
  .contact {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 48px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: calc(48px + env(safe-area-inset-top));
    padding-bottom: calc(48px + env(safe-area-inset-bottom));
  }
  .contact-container {
    max-width: 100%;
  }
  .contact-container h2 {
    font-size: 1.8rem;
  }
  .contact-form {
    padding: 24px 16px;
    width: 100%;
  }
  .contact-form input,
  .contact-form textarea {
    font-size: 16px; /* Prevents iOS zoom on focus */
  }
  .contact-form button.cta-btn {
    align-self: center;
    width: 100%;
    max-width: 260px;
  }

  /* ===== FOOTER ===== */
  footer {
    font-size: 0.9rem;
    padding: 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }

  /* ===== DARK MODE MOBILE ===== */
  body.dark-mode .cta-btn {
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.1);
  }
  body.dark-mode .cta-btn-secondary {
    border-width: 1px;
  }
  body.dark-mode .about-avatar img {
    border: 1px solid rgba(255, 59, 63, 0.3);
    box-shadow: none;
  }
  body.dark-mode .portfolio-card .visit-btn {
    border-width: 1px;
  }

  /* ===== MOBILE TOUCH OPTIMIZATIONS ===== */
  a, button {
    -webkit-tap-highlight-color: transparent;
  }
}

/* Responsive – Very small screens (small Android phones, iPhone SE, etc.) */
@media (max-width: 480px) {
  section[id] {
    scroll-margin-top: 52px;
  }

  .navbar {
    padding: 8px 10px;
    margin: 6px;
    width: calc(100% - 12px);
    border-radius: 20px;
  }
  .hero {
    padding-top: calc(56px + env(safe-area-inset-top));
    padding-bottom: 16px;
  }
  .hero-content {
    gap: clamp(8px, 2vh, 16px);
  }
  .hero-text h1 {
    font-size: clamp(1.2rem, 5vw, 1.5rem);
  }
  .hero-text p {
    font-size: 0.9rem;
  }
  .hero-image {
    max-height: clamp(100px, 25vh, 180px);
  }
  .hero-image img {
    max-height: clamp(100px, 25vh, 180px);
  }
  .cta-btn {
    padding: 10px 20px;
    font-size: 0.9rem;
    max-width: 220px;
  }
  .about-me,
  .portfolio,
  .services,
  .contact {
    padding: 32px 12px;
    padding-top: calc(32px + env(safe-area-inset-top));
  }
  .about-avatar img {
    width: clamp(120px, 25vw, 160px);
    height: clamp(120px, 25vw, 160px);
  }
  .about-info h2,
  .contact-info h2 {
    font-size: 1.4rem;
  }
  .about-info p {
    font-size: 0.95rem;
  }
  .portfolio-container h2,
  .services-container h2 {
    font-size: 1.5rem;
  }
  .skill-card {
    padding: 16px 12px;
  }
  .skill-group p {
    font-size: 0.85rem;
  }
  .skill-icon {
    width: 28px;
    height: 28px;
  }
  .contact-item {
    font-size: 0.9rem;
  }
  .contact-form {
    padding: 20px 12px;
  }
  .services-card img {
    height: 130px;
  }
}

/* ============================================
   MOBILE LANDSCAPE MODE
   Targets phones held sideways (wide + short)
   ============================================ */
@media (max-height: 500px) and (orientation: landscape) {
  /* Anchor offset for shorter navbar */
  section[id] {
    scroll-margin-top: 52px;
  }

  /* ===== NAVBAR ===== */
  .navbar {
    padding: 6px 16px;
    margin: 4px;
    width: calc(100% - 8px);
    border-radius: 20px;
  }
  .navbar .logo img {
    height: 24px;
  }

  /* ===== HERO ===== */
  .hero {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 48px 24px 12px;
    padding-left: calc(24px + env(safe-area-inset-left));
    padding-right: calc(24px + env(safe-area-inset-right));
    display: flex;
    justify-content: center;
  }
  .hero-content {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 24px;
    align-items: center;
    max-height: 100%;
  }
  .hero-text {
    flex: 1 1 50%;
    text-align: left;
  }
  .hero-text h1 {
    font-size: clamp(1rem, 3.5vw, 1.6rem);
    margin-bottom: 6px;
    line-height: 1.2;
  }
  .hero-text p {
    font-size: clamp(0.75rem, 2vw, 0.95rem);
    margin-top: 4px;
    margin-bottom: 8px;
  }
  .hero-image {
    flex: 1 1 45%;
    max-height: 70vh;
  }
  .hero-image img {
    max-height: 60vh;
    max-width: 100%;
    object-fit: cover;
    border-radius: 12px;
  }
  .hero-buttons {
    flex-direction: row;
    gap: 10px;
    margin-top: 8px;
  }
  .cta-btn {
    padding: 8px 18px;
    font-size: 0.8rem;
    width: auto;
    max-width: none;
  }
  .cta-btn-secondary {
    padding: 6px 16px;
  }

  /* ===== ABOUT ===== */
  .about-me {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 48px 24px 16px;
    padding-left: calc(24px + env(safe-area-inset-left));
    padding-right: calc(24px + env(safe-area-inset-right));
  }
  .about-container {
    flex-direction: row;
    flex-wrap: nowrap;
    text-align: left;
    gap: 24px;
    align-items: flex-start;
  }
  .about-avatar {
    flex: 0 0 auto;
    margin-left: 0;
    justify-content: center;
  }
  .about-avatar img {
    width: 120px;
    height: 120px;
  }
  .about-info {
    flex: 1;
    align-items: flex-start;
  }
  .about-info h2 {
    font-size: 1.3rem;
    margin-bottom: 8px;
  }
  .about-info p {
    font-size: 0.85rem;
    margin-bottom: 12px;
  }
  .about-info h3 {
    font-size: 1rem;
    margin-bottom: 6px;
  }
  .skills-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
  .skill-card {
    padding: 12px 10px;
    min-height: auto;
  }
  .skill-group h4 {
    font-size: 0.8rem;
  }
  .skill-group p {
    font-size: 0.7rem;
    margin-bottom: 6px;
  }
  .skill-icon {
    width: 24px;
    height: 24px;
  }
  .skills-footer {
    font-size: 0.8rem;
    margin-top: 12px;
  }

  /* ===== PORTFOLIO ===== */
  .portfolio {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 48px 24px 16px;
    padding-left: calc(24px + env(safe-area-inset-left));
    padding-right: calc(24px + env(safe-area-inset-right));
    align-items: flex-start;
  }
  .portfolio-container h2 {
    font-size: 1.4rem;
    margin-bottom: 16px;
  }
  .portfolio-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
  }
  .portfolio-card {
    padding: 12px 10px 16px;
  }
  .portfolio-card h3 {
    font-size: 1rem;
  }
  .portfolio-card p {
    font-size: 0.85rem;
  }

  /* ===== SERVICES ===== */
  .services {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 48px 24px 16px;
    padding-left: calc(24px + env(safe-area-inset-left));
    padding-right: calc(24px + env(safe-area-inset-right));
    align-items: flex-start;
  }
  .services-container h2 {
    font-size: 1.4rem;
    margin-bottom: 16px;
  }
  .services-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
  .services-card {
    padding: 12px 10px 16px;
  }
  .services-card img {
    height: 100px;
  }
  .services-card h3 {
    font-size: 1rem;
  }
  .services-card p {
    font-size: 0.85rem;
  }

  /* ===== CONTACT ===== */
  .contact {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 48px 24px 16px;
    padding-left: calc(24px + env(safe-area-inset-left));
    padding-right: calc(24px + env(safe-area-inset-right));
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }
  .contact-inner {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 24px;
    text-align: left;
    align-items: flex-start;
  }
  .contact-info {
    flex: 1;
    align-items: flex-start;
  }
  .contact-info h2 {
    font-size: 1.3rem;
  }
  .contact-info p {
    font-size: 0.9rem;
    margin-bottom: 8px;
  }
  .contact-item {
    font-size: 0.85rem;
  }
  .contact-social .icon {
    width: 26px;
    height: 26px;
  }
  .contact-form {
    flex: 1;
    padding: 16px 14px;
  }
  .contact-form input,
  .contact-form textarea {
    padding: 8px 10px;
    font-size: 14px;
  }
  .contact-form textarea {
    rows: 3;
  }
  .contact-form button.cta-btn {
    padding: 8px 20px;
    font-size: 0.85rem;
    align-self: flex-end;
    width: auto;
    max-width: none;
  }

  /* ===== FOOTER ===== */
  footer {
    padding: 10px;
    font-size: 0.8rem;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
  }
}

/* ============================================
   ROMANIAN LANGUAGE – Smaller text for Hero & About
   Targets html[lang="ro"] set by the language toggle
   ============================================ */

/* Desktop */
html[lang="ro"] .hero-text h1 {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
}
html[lang="ro"] .hero-text p {
  font-size: clamp(1.1rem, 2vw, 1.4rem);
}
html[lang="ro"] .about-info h2 {
  font-size: 1.8rem;
}
html[lang="ro"] .about-info p {
  font-size: 1.15rem;
}

/* Mobile phones */
@media (max-width: 768px) {
  html[lang="ro"] .hero-text h1 {
    font-size: clamp(1.1rem, 4.5vw, 1.8rem);
  }
  html[lang="ro"] .hero-text p {
    font-size: clamp(0.8rem, 2.8vw, 1.05rem);
  }
  html[lang="ro"] .about-info h2 {
    font-size: 1.5rem;
  }
  html[lang="ro"] .about-info p {
    font-size: 0.92rem;
  }
}

/* Very small screens */
@media (max-width: 480px) {
  html[lang="ro"] .hero-text h1 {
    font-size: clamp(1rem, 4.2vw, 1.3rem);
  }
  html[lang="ro"] .hero-text p {
    font-size: 0.8rem;
  }
  html[lang="ro"] .about-info h2 {
    font-size: 1.2rem;
  }
  html[lang="ro"] .about-info p {
    font-size: 0.85rem;
  }
}

/* Mobile landscape */
@media (max-height: 500px) and (orientation: landscape) {
  html[lang="ro"] .hero-text h1 {
    font-size: clamp(0.85rem, 3vw, 1.3rem);
  }
  html[lang="ro"] .hero-text p {
    font-size: clamp(0.65rem, 1.8vw, 0.85rem);
  }
  html[lang="ro"] .about-info h2 {
    font-size: 1.1rem;
  }
  html[lang="ro"] .about-info p {
    font-size: 0.75rem;
  }
}

