/* Decorative bottom image styles */
.bottom-image-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  background: transparent;
  margin-top: 3rem;
  margin-bottom: 0;
}
.bottom-image {
  max-width: 100vw;
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}
@media (max-width: 600px) {
  .bottom-image {
    max-width: 100vw;
    width: 100vw;
  }
}
/* Accent red utility class for headings and highlights */
.accent-red {
  color: #b74b4b;
}
.experience-subtext,
.certifications-subtext {
  font-size: 1.8rem;
  color: #aaa;
  margin: 1rem 0 3.5rem 0;
  text-align: center;
}
@media (width <=900px) {
  .experience-subtext,
  .certifications-subtext {
    font-size: 1.4rem;
    margin: 1rem 0 2.2rem 0;
  }
}
.cert-title.center {
  display: block;
  width: 100%;
  text-align: center;
}
/* EXPERIENCE GRID & CARD ENHANCEMENTS */
.experience-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3rem;
  width: 90%;
  max-width: 1100px;
  margin: 0 auto 4rem auto;
}
@media (width <=900px) {
  .experience-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
    width: 100%;
  }
}
.experience-card {
  background: linear-gradient(135deg, #0a0a0a 0%, #111 100%);
  border: 2px solid #1a1a1a;
  border-radius: 1.2rem;
  padding: 2.5rem 2rem;
  box-shadow: 0 5px 15px rgb(0 0 0 / 50%), inset 0 1px 0 rgb(183 75 75 / 10%);
  transition: all 0.3s cubic-bezier(.4,2,.6,1);
  text-align: left;
  position: relative;
  overflow: hidden;
  min-height: 180px;
}
.experience-card:hover {
  border-color: #b74b4b;
  box-shadow: 0 15px 40px rgb(183 75 75 / 30%), inset 0 1px 0 rgb(183 75 75 / 20%);
  transform: translateY(-8px) scale(1.025);
  background: linear-gradient(135deg, #111 0%, #191919 100%);
}
.exp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.experience-card h3 {
  color: #b74b4b;
  font-size: 2rem;
  font-weight: 600;
  margin: 0;
}
.exp-duration {
  font-size: 1.3rem;
  color: #aaa;
  font-weight: 500;
}
.exp-role {
  font-size: 1.5rem;
  color: #fff;
  margin: 0.5rem 0 0.2rem 0;
  font-weight: 500;
}
.exp-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  font-size: 1.2rem;
  color: #bbb;
  margin-top: 0.2rem;
}
.exp-dates, .exp-location {
  display: inline-block;
  font-size: 1.2rem;
  color: #bbb;
}
@media (width <=900px) {
  .experience-card {
    padding: 1.5rem 1rem;
  }
  .experience-card h3 {
    font-size: 1.5rem;
  }
  .exp-role {
    font-size: 1.2rem;
  }
}

/* CERTIFICATIONS GRID & CARD ENHANCEMENTS */
.certifications-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  width: 90%;
  max-width: 900px;
  margin: 0 auto 4rem auto;
}
@media (width <=900px) {
  .certifications-grid {
    grid-template-columns: 1fr;
    gap: 1.2rem;
    width: 100%;
  }
}
.cert-card {
  background: #111;
  color: #fff;
  border-left: 4px solid #b74b4b;
  border-radius: 0.7rem;
  padding: 1.5rem 2rem;
  font-size: 1.5rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.2s, transform 0.3s cubic-bezier(.4,2,.6,1);
  box-shadow: 0 2px 10px rgb(183 75 75 / 10%);
  margin-bottom: 0;
  min-height: 60px;
  position: relative;
  overflow: hidden;
}
.cert-card:hover {
  background: #191919;
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 8px 25px rgb(183 75 75 / 20%);
}
.cert-title {
  font-weight: 600;
  color: #fff;
  font-size: 1.4rem;
}
.cert-date {
  color: #b74b4b;
  font-size: 1.2rem;
  font-weight: 500;
  margin-left: 1.5rem;
}
@media (width <=900px) {
  .cert-card {
    font-size: 1.1rem;
    padding: 1rem 1rem;
  }
  .cert-title {
    font-size: 1.1rem;
  }
  .cert-date {
    font-size: 1rem;
  }
}
/* ================= EXPERIENCE SECTION ================= */
.experience {
  min-height: 70vh;
  background: black;
  padding: 6rem 9%;
  text-align: center;
  position: relative;
}

.experience-side-label {
  position: absolute;
  left: 3.5rem;
  top: 50%;
  transform: translateY(-50%) rotate(-90deg);
  transform-origin: left center;
  letter-spacing: 0.2rem;
  color: #b74b4b;
  font-weight: 700;
  font-size: 1.8rem;
  background: transparent;
  padding: 0.4rem 0;
  z-index: 10;
}
.experience-side-label::after {
  content: "";
  display: block;
  width: 120px;
  height: 3px;
  background: #b74b4b;
  margin-top: 0.8rem;
  opacity: 0.85;
}
@media (width <=900px) {
  .experience-side-label {
    display: none;
  }
}
.experience-heading {
  font-size: 4rem;
  font-weight: 700;
  color: white;
  margin-bottom: 2.5rem;
}
.experience-heading span {
  color: #b74b4b;
}
.experience-list {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  align-items: center;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}
.experience-card {
  background: #0a0a0a;
  border: 2px solid #111;
  border-radius: 1.2rem;
  padding: 2.5rem 2rem;
  width: 100%;
  text-align: left;
  box-shadow: 0 0 15px rgb(183 75 75 / 10%);
  transition: 0.3s ease;
}
.experience-card:hover {
  border-color: #b74b4b;
  box-shadow: 0 0 25px rgb(183 75 75 / 30%);
  transform: translateY(-6px);
}
.experience-card h3 {
  color: #b74b4b;
  font-size: 2.1rem;
  margin-bottom: 0.5rem;
}
.exp-duration {
  font-size: 1.3rem;
  color: #aaa;
  margin-right: 1.5rem;
}
.exp-role {
  font-size: 1.5rem;
  color: #fff;
  margin: 0.5rem 0 0.2rem 0;
}
.exp-dates, .exp-location {
  display: inline-block;
  font-size: 1.2rem;
  color: #bbb;
  margin-right: 1.5rem;
  margin-top: 0.2rem;
}
@media (width <=900px) {
  .experience-list {
    gap: 1.5rem;
    padding: 0 1rem;
  }
  .experience-card {
    padding: 1.5rem 1rem;
  }
  .experience-heading {
    font-size: 2.5rem;
  }
}

/* ================= CERTIFICATIONS SECTION ================= */
.certifications {
  min-height: 50vh;
  background: #0a0a0a;
  padding: 6rem 9%;
  text-align: center;
  position: relative;
}
.certifications-side-label {
  position: absolute;
  left: 3.5rem;
  top: 50%;
  transform: translateY(-50%) rotate(-90deg);
  transform-origin: left center;
  letter-spacing: 0.2rem;
  color: #b74b4b;
  font-weight: 700;
  font-size: 1.8rem;
  background: transparent;
  padding: 0.4rem 0;
  z-index: 10;
}
.certifications-side-label::after {
  content: "";
  display: block;
  width: 120px;
  height: 3px;
  background: #b74b4b;
  margin-top: 0.8rem;
  opacity: 0.85;
}
@media (width <=900px) {
  .certifications-side-label {
    display: none;
  }
}
.certifications-heading {
  font-size: 4rem;
  font-weight: 700;
  color: white;
  margin-bottom: 2.5rem;
}
.certifications-heading span {
  color: #b74b4b;
}
.certifications-list {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: 700px;
  text-align: left;
}
.certifications-list li {
  background: #111;
  color: #fff;
  border-left: 4px solid #b74b4b;
  margin-bottom: 1.2rem;
  padding: 1.2rem 1.5rem;
  border-radius: 0.7rem;
  font-size: 1.5rem;
  transition: background 0.2s;
}
.certifications-list li:hover {
  background: #191919;
}
@media (width <=900px) {
  .certifications-heading {
    font-size: 2.5rem;
  }
  .certifications-list li {
    font-size: 1.2rem;
    padding: 1rem 1rem;
  }
}
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600&display=swap");

html {
  font-size: 62.5%;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ===== COMPREHENSIVE BREAKPOINTS FOR ALL RESOLUTIONS ===== */

/* Mobile: 320px - 767px */
@media (width <=480px) {
  html {
    font-size: 50%;
  }
}

@media (width >=481px) and (width < 600px) {
  html {
    font-size: 54%;
  }
}

@media (width >=600px) and (width < 768px) {
  html {
    font-size: 56%;
  }
}

/* Tablets: 768px - 1023px */
@media (width >=768px) and (width < 1024px) {
  html {
    font-size: 60%;
  }
}

/* iPad & Small Laptops: 1024px - 1365px */
@media (width >=1024px) and (width < 1280px) {
  html {
    font-size: 61%;
  }
}

@media (width >=1280px) and (width < 1366px) {
  html {
    font-size: 61.5%;
  }
}

/* Common Laptop: 1366x768 */
@media (width >=1366px) and (width < 1440px) {
  html {
    font-size: 62%;
  }
}

/* 1440p (QHD) Standard Desktop */
@media (width >=1440px) and (width < 1600px) {
  html {
    font-size: 62.5%;
  }
}

/* 1600p Large Desktop */
@media (width >=1600px) and (width < 1920px) {
  html {
    font-size: 63%;
  }
}

/* 1920p (Full HD) */
@media (width >=1920px) and (width < 2560px) {
  html {
    font-size: 64%;
  }
}

/* 2560p (4K) and beyond */
@media (width >=2560px) {
  html {
    font-size: 65%;
  }
}

/* High DPI / Retina Display Support */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  * {
    -webkit-font-smoothing: subpixel-antialiased;
  }
  
  .navbar, section, .footer {
    border-width: 0.5px;
  }
  
  .skill-card, .experience-card, .certifications-list li, .project-card, .contact-form {
    border-width: 1px;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  button, a, .btn, .nav-link, .skill-card, .experience-card, .project-card {
    padding: max(0.75rem, 16px) max(1rem, 16px);
    min-height: 44px;
    min-width: 44px;
  }
  
  .skill-card:active, .experience-card:active, .project-card:active {
    background: #111;
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  text-decoration: none;
  border: none;
  outline: none;
  font-family: Poppins, sans-serif;
}

/* Responsive media elements */
img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input, button, textarea, select {
  font: inherit;
}

body {
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  background: linear-gradient(135deg, #000 0%, #0a0a0a 100%);
  color: white;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

/* ===== ISOLATED STICKY NAVBAR ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: clamp(0.8rem, 2%, 1.2rem) 0;
  background-color: rgb(16 16 16 / 95%);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgb(183 75 75 / 20%);
  box-shadow: 0 4px 15px rgb(0 0 0 / 30%);
  z-index: 1000;
}

.navbar-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 clamp(4%, 5%, 9%);
  width: 100%;
}

.navbar-logo {
  flex-shrink: 0;
}

.navbar-logo a {
  font-size: 0;
  text-decoration: none;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 50px;
}

.navbar-logo a:hover {
  transform: scale(1.05);
}

.navbar-logo img {
  height: 50px;
  width: auto;
  object-fit: contain;
  display: block;
  transition: all 0.3s ease;
  filter: drop-shadow(0 0 15px rgb(183 75 75 / 0%));
}

.navbar-logo a:hover img {
  filter: drop-shadow(0 0 15px rgb(183 75 75 / 60%));
}

/* Navigation Menu */
.navbar-menu {
  display: flex;
  gap: 2.5rem;
  align-items: center;
}

.nav-link {
  font-size: 1.6rem;
  color: #e0e0e0;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
  padding: 0.5rem 0;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: #b74b4b;
  transition: width 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
  color: #b74b4b;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-link:focus {
  outline: 2px solid #b74b4b;
  outline-offset: 4px;
  border-radius: 2px;
}

/* Hamburger Menu Button */
.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  z-index: 101;
  gap: 0.5rem;
}

.hamburger span {
  width: 2.5rem;
  height: 0.3rem;
  background-color: #b74b4b;
  border-radius: 0.2rem;
  transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(12px, 12px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(8px, -8px);
}

/* Mobile Navigation (<=995px) */
@media (width <=995px) {
  .hamburger {
    display: flex;
  }

  .navbar-menu {
    position: fixed;
    top: 70px;
    right: 0;
    width: 100%;
    max-width: 350px;
    height: 0;
    overflow: hidden;
    flex-direction: column;
    gap: 0;
    background-color: rgb(22 22 22 / 98%);
    border-left: 2px solid #b74b4b;
    padding: 0;
    transition: height 0.3s ease;
    z-index: 99;
  }

  .navbar-menu.active {
    height: auto;
    max-height: calc(100vh - 70px);
    padding: 2rem 1.5rem;
    gap: 1rem;
  }

  .nav-link {
    font-size: 1.8rem;
    padding: 1rem;
    width: 100%;
  }

  .nav-link::after {
    display: none;
  }

  .nav-link:hover,
  .nav-link.active {
    background-color: rgb(183 75 75 / 15%);
    padding-left: 1.5rem;
    border-left: 3px solid #b74b4b;
  }
}

/* Desktop Navigation (>995px) */
@media (width > 995px) {
  .navbar-menu {
    display: flex !important;
    height: auto !important;
  }
}

section {
  min-height: 100vh;
  padding: clamp(3rem, 5%, 5rem) clamp(4%, 9%, 9%);
  margin-top: 120px;
  scroll-margin-top: 80px;
}

.home {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8rem;
  background-color: black;
  padding-top: 12rem;
}

/* Responsive gaps for home section */
@media (width >=768px) and (width < 1024px) {
  .home {
    gap: 5rem;
  }
}

@media (width >=1024px) and (width < 1280px) {
  .home {
    gap: 6rem;
  }
}

@media (width >=1280px) {
  .home {
    gap: 8rem;
  }
}

.home .home-content h1 {
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -1px;
  text-shadow: 0 2px 10px rgb(183 75 75 / 20%);
}

@media (width >=768px) and (width < 1024px) {
  .home .home-content h1 {
    font-size: 4.2rem;
  }
}

@media (width >=1024px) and (width < 1440px) {
  .home .home-content h1 {
    font-size: 4.5rem;
  }
}

@media (width >=1440px) {
  .home .home-content h1 {
    font-size: 3.8rem;
  }
}

@media (width >=1920px) {
  .home .home-content h1 {
    font-size: 4rem;
  }
}

span {
  color: #b74b4b;
}

.home-content h3 {
  font-size: 4rem;
  margin-bottom: 1rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #b74b4b;
}

@media (width >=768px) and (width < 1024px) {
  .home-content h3 {
    font-size: 2.8rem;
  }
}

@media (width >=1024px) and (width < 1440px) {
  .home-content h3 {
    font-size: 3.2rem;
  }
}

@media (width >=1440px) {
  .home-content h3 {
    font-size: 4rem;
  }
}

@media (width >=1920px) {
  .home-content h3 {
    font-size: 4.5rem;
  }
}

.home-content p {
  font-size: 1.6rem;
  line-height: 1.8;
  color: #ccc;
}

@media (width >=768px) and (width < 1024px) {
  .home-content p {
    font-size: 1.5rem;
  }
}

@media (width >=1024px) and (width < 1440px) {
  .home-content p {
    font-size: 1.55rem;
  }
}

@media (width >=1440px) {
  .home-content p {
    font-size: 1.6rem;
  }
}

@media (width >=1920px) {
  .home-content p {
    font-size: 1.7rem;
  }
}

.home-img {
  border-radius: 50%;
}

.home-img img {
  position: relative;
  width: 32vw;
  min-width: 250px;
  max-width: 450px;
  border-radius: 50%;
  box-shadow: 0 0 30px rgb(183 75 75 / 40%), inset 0 0 30px rgb(183 75 75 / 10%);
  cursor: pointer;
  transition: all 0.4s ease;
}

@media (width >=768px) and (width < 1024px) {
  .home-img img {
    width: 35vw;
    min-width: 220px;
    max-width: 350px;
  }
}

@media (width >=1024px) and (width < 1280px) {
  .home-img img {
    width: 33vw;
    min-width: 280px;
    max-width: 400px;
  }
}

@media (width >=1280px) {
  .home-img img {
    width: 32vw;
    min-width: 300px;
    max-width: 450px;
  }
}

@media (width >=1920px) {
  .home-img img {
    width: 30vw;
    min-width: 350px;
    max-width: 500px;
  }
}

.home-img img:hover {
  box-shadow: 0 0 50px rgb(183 75 75 / 60%), inset 0 0 30px rgb(183 75 75 / 20%);
  transform: scale(1.05);
}

.social-icons a {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: clamp(3rem, 8vw, 4rem);
  height: clamp(3rem, 8vw, 4rem);
  background-color: transparent;
  border: 2px solid #b74b4b;
  font-size: clamp(1.6rem, 3vw, 2rem);
  border-radius: 50%;
  margin: 2rem clamp(0.8rem, 2vw, 1.5rem) 2rem 0;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  color: #b74b4b;
}

.social-icons a:hover,
.social-icons a:focus {
  color: black;
  transform: scale(1.3) translateY(-5px);
  background-color: #b74b4b;
  box-shadow: 0 0 30px rgb(183 75 75 / 60%), 0 0 50px rgb(183 75 75 / 30%);
  border-color: #b74b4b;
}

.btn {
  display: inline-block;
  padding: clamp(0.8rem, 2vw, 1rem) clamp(2rem, 4vw, 2.8rem);
  background-color: black;
  border-radius: 4rem;
  font-size: clamp(1.4rem, 2.5vw, 1.6rem);
  color: #b74b4b;
  letter-spacing: 0.3rem;
  font-weight: 600;
  border: 2px solid #b74b4b;
  transition: all 0.4s ease;
  cursor: pointer;
  position: relative;
  min-height: 44px;
  min-width: 44px;
}

.btn:hover,
.btn:focus {
  transform: translateY(-3px) scale(1.03);
  background-color: #b74b4b;
  color: black;
  box-shadow: 0 10px 30px rgb(183 75 75 / 40%);
}

.btn:active {
  transform: translateY(-1px);
}

.typing-text {
  font-size: 34px;
  font-weight: 600;
  min-width: 280px;
  color: white;
  display: flex;
  align-items: center;
}

.typing-text span {
  position: relative;
}

.typing-text #typing {
  color: #b74b4b;
  border-right: 3px solid #b74b4b;
  white-space: nowrap;
  overflow: hidden;
  animation: blink 0.6s step-end infinite alternate;
}

/* Cursor blinking */
@keyframes blink {
  50% {
    border-color: transparent;
  }
}

/* Typing effect */
@keyframes typing {
  0% {
    width: 0;
    content: "DevOps Engineer";
  }

  30% {
    width: 15ch;
    content: "DevOps Engineer";
  }

  40% {
    width: 0;
    content: "Cloud Engineer";
  }

  70% {
    width: 23ch;
    content: "Cloud Engineer";
  }

  80% {
    width: 0;
    content: "Freelancer";
  }

  100% {
    width: 11ch;
    content: "Freelancer";
  }
}

@media (width <=1000px) {
  .home {
    gap: 4rem;
  }
}

@media(width <=995px) {
  .home {
    flex-direction: column;
    margin: 5rem 4rem;
  }

  .home .home-content h3 {
    font-size: 2.5rem;
  }

  .home-content h1 {
    font-size: 5rem;
  }

  .home-img img {
    width: 70vw;
    margin-top: 4rem;
  }
}

/* ===== CONTACT SECTION ===== */
.contact {
  background-color: black;
  padding: 6rem 9%;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 90vh;
  position: relative;
}

@media (width >=768px) and (width < 1024px) {
  .contact {
    padding: 5rem 9%;
  }
}

@media (width >=1024px) and (width < 1440px) {
  .contact {
    padding: 5.5rem 9%;
  }
}

@media (width >=1440px) {
  .contact {
    padding: 6rem 9%;
  }
}

@media (width >=1920px) {
  .contact {
    padding: 7rem 9%;
  }
}

.contact-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 2px solid #b74b4b;
  border-radius: 2rem;
  padding: 4rem 5rem;
  width: 90%;
  max-width: 1200px;
  background: linear-gradient(135deg, rgb(10 10 10 / 80%) 0%, rgb(17 17 17 / 80%) 100%);
  color: white;
  gap: 3rem;
  transition: all 0.4s ease;
  box-shadow: 0 10px 40px rgb(183 75 75 / 15%);
}

@media (width >=768px) and (width < 1024px) {
  .contact-container {
    padding: 3rem 3.5rem;
    gap: 2.5rem;
    max-width: 1000px;
  }
}

@media (width >=1024px) and (width < 1280px) {
  .contact-container {
    padding: 3.5rem 4rem;
    gap: 2.8rem;
    max-width: 1100px;
  }
}

@media (width >=1280px) {
  .contact-container {
    padding: 4rem 5rem;
    gap: 3rem;
    max-width: 1200px;
  }
}

@media (width >=1920px) {
  .contact-container {
    padding: 5rem 6rem;
    gap: 4rem;
    max-width: 1400px;
  }
}

.contact-container:hover {
  box-shadow: 0 20px 60px rgb(183 75 75 / 25%);
  transform: translateY(-5px);
  border-color: #b74b4b;
}

.contact-left {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
  text-align: center;
}

.contact-left-content h3 {
  font-size: 2.4rem;
  color: #fff;
  margin: 0 0 0.3rem;
}

.contact-left-content a {
  font-size: 1.8rem;
  color: #b74b4b;
  text-decoration: none;
  word-break: break-all;
}

.contact-left-content a:hover {
  color: #fff;
  text-decoration: underline;
}

.mail-icon {
  font-size: 14rem;
  color: transparent;
  -webkit-text-stroke: 2px #b74b4b;

  /* outlined mail icon */
}

.contact-right {
  flex: 1;
}

.contact-right .heading {
  font-size: 3.5rem;
  margin-bottom: 2rem;
  font-weight: 700;
  text-align: left;
}

@media (width >=768px) and (width < 1024px) {
  .contact-right .heading {
    font-size: 2.8rem;
  }
}

@media (width >=1024px) and (width < 1440px) {
  .contact-right .heading {
    font-size: 3rem;
  }
}

@media (width >=1440px) {
  .contact-right .heading {
    font-size: 3.5rem;
  }
}

@media (width >=1920px) {
  .contact-right .heading {
    font-size: 4rem;
  }
}

.contact-right .heading span {
  color: #b74b4b;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: clamp(0.8rem, 2vw, 1.2rem) clamp(1rem, 2.5vw, 1.5rem);
  border: 2px solid #333;
  background: rgb(255 255 255 / 2%);
  color: white;
  border-radius: 1rem;
  font-size: clamp(1.3rem, 2vw, 1.6rem);
  transition: all 0.4s ease;
  min-height: 44px;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: #888;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: #b74b4b;
  box-shadow: 0 0 20px rgb(183 75 75 / 30%), inset 0 0 10px rgb(183 75 75 / 5%);
  background: rgb(255 255 255 / 4%);
  transform: translateY(-2px);
}

.contact-form .btn {
  align-self: flex-start;
  background-color: black;
  color: #b74b4b;
  border: 2px solid #b74b4b;
  border-radius: 4rem;
  padding: clamp(0.8rem, 2vw, 1rem) clamp(2rem, 4vw, 2.8rem);
  font-size: clamp(1.4rem, 2.5vw, 1.6rem);
  font-weight: 600;
  letter-spacing: 0.2rem;
  cursor: pointer;
  transition: 0.3s ease;
  min-height: 44px;
}

.contact-form .btn:hover,
.contact-form .btn:focus {
  background-color: #b74b4b;
  color: black;
  box-shadow: 0 0 25px #b74b4b;
  transform: scale(1.05);
}

.contact-form .btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background-color: #b74b4b;
  color: black;
}

.contact-form .btn:disabled:hover {
  transform: scale(1);
  box-shadow: 0 0 15px #b74b4b;
}

/* Responsive layout */
@media (width <=900px) {
  .contact-container {
    flex-direction: column;
    text-align: center;
  }

  .mail-icon {
    font-size: 10rem;
    margin-bottom: 2rem;
  }

  .contact-right .heading {
    text-align: center;
  }

  .contact-form .btn {
    align-self: center;
  }
}

/* ================= SKILLS SECTION ================= */
.skills {
  min-height: 90vh;
  background-color: black;
  padding: 6rem 9%;
  text-align: center;
  position: relative;
}

@media (width >=768px) and (width < 1024px) {
  .skills {
    padding: 5rem 9%;
  }
}

@media (width >=1024px) and (width < 1440px) {
  .skills {
    padding: 5.5rem 9%;
  }
}

@media (width >=1440px) {
  .skills {
    padding: 6rem 9%;
  }
}

@media (width >=1920px) {
  .skills {
    padding: 7rem 9%;
  }
}


.skills-heading {
  font-size: 4rem;
  font-weight: 700;
  color: white;
}

@media (width >=768px) and (width < 1024px) {
  .skills-heading {
    font-size: 3rem;
  }
}

@media (width >=1024px) and (width < 1440px) {
  .skills-heading {
    font-size: 3.5rem;
  }
}

@media (width >=1440px) {
  .skills-heading {
    font-size: 4rem;
  }
}

@media (width >=1920px) {
  .skills-heading {
    font-size: 4.5rem;
  }
}

.skills-heading span {
  color: #b74b4b;
}

.skills-subtext {
  font-size: 1.8rem;
  color: #aaa;
  margin: 1rem 0 4rem;
}

@media (width >=768px) and (width < 1024px) {
  .skills-subtext {
    font-size: 1.5rem;
    margin: 1rem 0 3rem;
  }
}

@media (width >=1024px) and (width < 1440px) {
  .skills-subtext {
    font-size: 1.6rem;
    margin: 1rem 0 3.5rem;
  }
}

@media (width >=1440px) {
  .skills-subtext {
    font-size: 1.8rem;
    margin: 1rem 0 4rem;
  }
}

@media (width >=1920px) {
  .skills-subtext {
    font-size: 1.9rem;
    margin: 1rem 0 4.5rem;
  }
}

/* Responsive columns: 4 on desktop, 5 on 1600px+, adjusts with gap */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 3rem;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

@media (width >=768px) and (width < 1024px) {
  .skills-grid {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
    gap: 2.2rem;
  }
}

@media (width >=1024px) and (width < 1280px) {
  .skills-grid {
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 2.5rem;
  }
}

@media (width >=1280px) and (width < 1600px) {
  .skills-grid {
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 2.8rem;
  }
}

@media (width >=1600px) {
  .skills-grid {
    grid-template-columns: repeat(5, minmax(160px, 1fr));
    gap: 3rem;
  }
}

@media (width >=1920px) {
  .skills-grid {
    grid-template-columns: repeat(5, minmax(170px, 1fr));
    gap: 3.5rem;
  }
}

/* fallback for narrow screens */
@media (width <=900px) {
  .skills-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 2rem;
  }
}

.skill-card {
  background: #0a0a0a;
  border-radius: 1rem;
  padding: 2rem;
  text-align: center;
  border: 2px solid #111;
  transition: 0.3s ease;
  box-shadow: 0 0 10px rgb(183 75 75 / 0%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.skill-card img {
  width: 70px;
  height: 70px;
  object-fit: contain;
  margin: 0 0 1.5rem 0;
}


.skill-card p {
  font-size: 1.6rem;
  color: white;
  font-weight: 500;
}

/* Hover Effects */
.skill-card:hover {
  transform: translateY(-8px);
  border-color: #b74b4b;
  box-shadow: 0 0 25px rgb(183 75 75 / 60%);
}

/* the vertical label */
.skills-side-label {
  position: absolute;
  left: 3.5rem;

  /* distance from left page edge; tweak as needed */
  top: 50%;
  transform: translateY(-50%) rotate(-90deg);

  /* rotate to be vertical */
  transform-origin: left center;
  letter-spacing: 0.2rem;
  color: #b74b4b;
  font-weight: 700;
  font-size: 1.8rem;
  background: transparent;
  padding: 0.4rem 0;
  z-index: 10;
}

/* Add the little vertical divider line to mimic your earlier screenshot */
.skills-side-label::after {
  content: "";
  display: block;
  width: 120px;

  /* length of underline line (horizontal because rotated) */
  height: 3px;
  background: #b74b4b;
  margin-top: 0.8rem;
  opacity: 0.85;
}

/* hide on small screens so it doesn't collide */
@media (width <=900px) {
  .skills-side-label {
    display: none;
  }
}

@media (width >=901px) {
  .skills {
    padding-left: 9%;

    /* your existing padding likely fine; increase slightly if overlap */
  }
}

/* Projects side label */
.projects-side-label {
  position: absolute;
  left: 3.5rem;
  top: 50%;
  transform: translateY(-50%) rotate(-90deg);
  transform-origin: left center;
  letter-spacing: 0.2rem;
  color: #b74b4b;
  font-weight: 700;
  font-size: 1.8rem;
  background: transparent;
  padding: 0.4rem 0;
  z-index: 10;
}

.projects-side-label::after {
  content: "";
  display: block;
  width: 120px;
  height: 3px;
  background: #b74b4b;
  margin-top: 0.8rem;
  opacity: 0.85;
}

/* Contact side label */
.contact-side-label {
  position: absolute;
  left: 3.5rem;
  top: 50%;
  transform: translateY(-50%) rotate(-90deg);
  transform-origin: left center;
  letter-spacing: 0.2rem;
  color: #b74b4b;
  font-weight: 700;
  font-size: 1.8rem;
  background: transparent;
  padding: 0.4rem 0;
  z-index: 10;
}

.contact-side-label::after {
  content: "";
  display: block;
  width: 120px;
  height: 3px;
  background: #b74b4b;
  margin-top: 0.5rem;
  opacity: 0.85;
}

/* Hide side labels on small screens */
@media (width <=900px) {
  .projects-side-label,
  .contact-side-label {
    display: none;
  }
}

@media (width >=901px) {
  .projects {
    padding-left: 9%;
  }

  .contact {
    padding-left: 9%;
  }
}

/* ================= PROJECTS SECTION ================= */
.projects {
  min-height: 70vh;
  background: black;
  padding: 6rem 9%;
  text-align: center;
  position: relative;
}

@media (width >=768px) and (width < 1024px) {
  .projects {
    padding: 5rem 9%;
  }
}

@media (width >=1024px) and (width < 1440px) {
  .projects {
    padding: 5.5rem 9%;
  }
}

@media (width >=1440px) {
  .projects {
    padding: 6rem 9%;
  }
}

@media (width >=1920px) {
  .projects {
    padding: 7rem 9%;
  }
}

.projects-heading {
  font-size: 4rem;
  font-weight: 700;
  color: white;
}

@media (width >=768px) and (width < 1024px) {
  .projects-heading {
    font-size: 3rem;
  }
}

@media (width >=1024px) and (width < 1440px) {
  .projects-heading {
    font-size: 3.5rem;
  }
}

@media (width >=1440px) {
  .projects-heading {
    font-size: 4rem;
  }
}

@media (width >=1920px) {
  .projects-heading {
    font-size: 4.5rem;
  }
}

.projects-heading span {
  color: #b74b4b;
}

.projects-subtext {
  font-size: 1.8rem;
  color: #aaa;
  margin-bottom: 4rem;
}

@media (width >=768px) and (width < 1024px) {
  .projects-subtext {
    font-size: 1.5rem;
    margin-bottom: 3rem;
  }
}

@media (width >=1024px) and (width < 1440px) {
  .projects-subtext {
    font-size: 1.6rem;
    margin-bottom: 3.5rem;
  }
}

@media (width >=1440px) {
  .projects-subtext {
    font-size: 1.8rem;
    margin-bottom: 4rem;
  }
}

@media (width >=1920px) {
  .projects-subtext {
    font-size: 1.9rem;
    margin-bottom: 4.5rem;
  }
}

.projects-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7rem;
  align-items: stretch;
  width: 90%;
  max-width: 1200px;
  min-height: 350px;
  margin: 0 auto;
}

@media (width >=768px) and (width < 1024px) {
  .projects-container {
    gap: 4rem;
    width: 95%;
    max-width: 1000px;
  }
}

@media (width >=1024px) and (width < 1280px) {
  .projects-container {
    gap: 5.5rem;
    width: 92%;
    max-width: 1100px;
  }
}

@media (width >=1280px) {
  .projects-container {
    gap: 7rem;
    width: 90%;
    max-width: 1200px;
  }
}

@media (width >=1920px) {
  .projects-container {
    gap: 8rem;
    width: 88%;
    max-width: 1400px;
  }
}

.project-card {
  background: linear-gradient(135deg, #0a0a0a 0%, #111 100%);
  border: 2px solid #1a1a1a;
  border-radius: 1.5rem;
  padding: 3rem;
  transition: all 0.4s ease;
  text-align: left;
  box-shadow: 0 5px 15px rgb(0 0 0 / 50%), inset 0 1px 0 rgb(183 75 75 / 10%);
}

@media (width >=768px) and (width < 1024px) {
  .project-card {
    padding: 2rem;
  }
}

@media (width >=1024px) and (width < 1280px) {
  .project-card {
    padding: 2.5rem;
  }
}

@media (width >=1280px) {
  .project-card {
    padding: 3rem;
  }
}

@media (width >=1920px) {
  .project-card {
    padding: 3.5rem;
  }
}

.project-card:hover {
  border-color: #b74b4b;
  box-shadow: 0 15px 40px rgb(183 75 75 / 30%), inset 0 1px 0 rgb(183 75 75 / 20%);
  transform: translateY(-12px);
  background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 100%);
}

.project-card h3 {
  color: white;
  font-size: 2.2rem;
  margin-bottom: 1.5rem;
}

.project-card p {
  color: #ccc;
  font-size: 1.5rem;
  line-height: 2.2rem;
  margin-bottom: 2rem;
}

.project-buttons {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.project-btn {
  background: black;
  color: #b74b4b;
  border: 2px solid #b74b4b;
  border-radius: 3rem;
  padding: 0.8rem 2rem;
  font-size: 1.4rem;
  font-weight: 600;
  transition: all 0.4s ease;
  cursor: pointer;
}

.project-btn:hover {
  background: #b74b4b;
  color: black;
  box-shadow: 0 8px 25px rgb(183 75 75 / 40%);
  transform: translateY(-3px);
}

.footer {
  background: #0a0a0a;
  color: #f1f1f1;
  padding: clamp(2rem, 5%, 5rem);
  margin-top: auto;
}

.footer .box-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: clamp(1rem, 3vw, 2rem);
  max-width: 1200px;
  margin: 0 auto 2rem auto;
}

.footer .box h3 {
  color: #fff;
  font-size: clamp(1.6rem, 4vw, 2rem);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer .box p,
.footer .box a {
  color: #ccc;
  font-size: clamp(1.2rem, 2.5vw, 1.45rem);
  line-height: 2.2rem;
}

.footer .box a {
  display: inline;
  margin-bottom: 0.5rem;
  transition: color 0.3s ease;
  word-break: break-word;
}

.footer .box a:not(.email-link) {
  display: block;
  margin-bottom: 0.5rem;
}

.footer .box a:hover,
.footer .box a:focus {
  color: #b74b4b;
  text-decoration: underline;
}

.footer .email-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  white-space: normal;
  word-break: break-word;
}

.footer .email-link {
  display: inline;
  color: #ccc;
  transition: color 0.3s ease;
}

.footer .email-link:hover,
.footer .email-link:focus {
  color: #b74b4b;
  text-decoration: underline;
}

@media (max-width: 600px) {
  .footer .email-line {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }
}

.footer .share {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 2vw, 1rem);
  flex-wrap: wrap;
}

.footer .share a {
  width: clamp(2.4rem, 8vw, 3.2rem);
  height: clamp(2.4rem, 8vw, 3.2rem);
  display: grid;
  place-items: center;
  border: 2px solid #b74b4b;
  border-radius: 50%;
  color: #b74b4b;
  transition: all 0.3s ease;
  font-size: clamp(1rem, 3vw, 1.4rem);
}

.footer .share a:hover,
.footer .share a:focus {
  background: #b74b4b;
  color: black;
  transform: translateY(-2px);
}

.footer .credit {
  text-align: center;
  color: #aaa;
  font-size: clamp(1.2rem, 2.5vw, 1.4rem);
  margin-top: 2rem;
  word-break: break-word;
}

@media (max-width: 900px) {
  .footer .box-container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer .box {
    padding: 1rem 0;
  }
  
  .footer {
    padding: clamp(1.5rem, 4%, 3rem);
  }
}

@media (max-width: 600px) {
  .footer .box-container {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .footer .share {
    justify-content: center;
  }
  
  .footer {
    padding: 1.5rem 4%;
  }
}
}
}

/* ===========================
   📱 FULL RESPONSIVE FIXES
   =========================== */

/* --- GLOBAL FIXES --- */
@media (width <=768px) {
  html {
    font-size: 52%;

    /* smaller base font */
  }

  header {
    padding: 1.5rem 5%;
  }

  nav a {
    margin-left: 2rem;
  }

  /* HOME SECTION */
  .home {
    flex-direction: column;
    gap: 3rem;
    text-align: center;
    padding-top: 10rem;
  }

  .home-img img {
    width: 70vw;
  }

  .home-content h1 {
    font-size: 4rem;
  }

  .home-content h3 {
    font-size: 2.4rem;
  }

  .home-content p {
    font-size: 1.4rem;
    line-height: 2.2rem;
  }

  .social-icons {
    justify-content: center;
  }

  /* SKILLS SECTION */
  .skills-subtext {
    width: 95%;
    margin: 0 auto 3rem;
    font-size: 1.5rem;
  }

  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .skill-card {
    padding: 1.5rem 1rem;
  }

  .skill-card img {
    width: 55px;
    height: 55px;
  }

  /* PROJECTS SECTION */
  .projects-container {
    grid-template-columns: 1fr;

    /* one card per row */
    width: 100%;
    gap: 3rem;
  }

  .project-card {
    padding: 2rem;
  }

  .project-card h3 {
    font-size: 2rem;
  }

  .project-card p {
    font-size: 1.4rem;
  }

  /* CONTACT SECTION */
  .contact-container {
    flex-direction: column;
    padding: 3rem 2rem;
  }

  .mail-icon {
    font-size: 8rem;
  }

  .contact-right .heading {
    text-align: center;
    font-size: 2.8rem;
  }

  .contact-form input,
  .contact-form textarea {
    font-size: 1.4rem;
    padding: 1rem;
  }

  .contact-form .btn {
    width: 100%;
    text-align: center;
  }
}

/* HUGE PHONES FIX (MAX 480px) */
@media (width <=480px) {
  html {
    font-size: 47%;
  }

  .home-img img {
    width: 80vw;
  }

  .skills-grid {
    grid-template-columns: repeat(2, 1fr);

    /* 1 per row */
  }

  .projects-heading {
    font-size: 3rem;
  }

  .projects-subtext {
    font-size: 1.4rem;
  }
}

/* Remove huge empty gaps between sections ONLY on mobile */
@media (width <=768px) {
  section {
    min-height: 60vh !important;
    padding-top: 4rem;
    padding-bottom: 4rem;
  }

  .projects {
    padding-bottom: 2rem !important;
  }

  .projects-container {
    margin-bottom: 2rem !important;
  }
}

/* Justify home section paragraphs ONLY on mobile */
@media (width <=768px) {
  .home-content p {
    text-align: justify;
    text-justify: inter-word;
  }
}

/* Center the typing text ONLY on mobile */
@media (width <=768px) {
  .typing-text {
    text-align: center;
    justify-content: center;
    width: 100%;
  }
}

/* Fix typing text weird wrapping issue on mobile */
@media (width <=768px) {
  .typing-text {
    font-size: 2.5rem;

    /* smaller so long words fit */
    text-align: center;
    justify-content: center;
    width: 100%;
    white-space: nowrap;

    /* PREVENT line break */
    overflow: hidden;
  }

  #typing {
    white-space: nowrap !important;

    /* really force no wrapping */
    display: inline-block;
    max-width: 95vw;

    /* fit inside screen */
  }
}

/* Extra small screens (<600px) - phone optimization */
@media (width <=600px) {
  html {
    font-size: 55%;
  }

  header {
    padding: 1rem 5%;
  }

  .logo {
    font-size: 2.2rem;
  }

  .logo img {
    height: 75px;
    width: auto;
  }

  section {
    padding: 3rem 5%;
  }

  .home-content h1 {
    font-size: 4.5rem;
  }

  .home-content h3 {
    font-size: 2.5rem;
  }

  .home-content p {
    font-size: 1.4rem;
  }

  .skills-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
    gap: 1.5rem;
  }

  .skill-card {
    padding: 1.5rem;
  }

  .skill-card img {
    width: 60px;
    height: 60px;
  }

  .btn {
    padding: 0.8rem 2rem;
    font-size: 1.4rem;
  }

  .home-img img {
    width: 85vw;
  }

  .skills-side-label {
    font-size: 1.4rem;
  }

  .projects-container {
    flex-direction: column;
  }

  .project-card {
    width: 100%;
  }

  .contact-container {
    flex-direction: column;
    gap: 2rem;
  }

  .contact-left {
    text-align: center;
  }

  .contact-form input,
  .contact-form textarea {
    font-size: 1.4rem;
    padding: 1rem 1.2rem;
  }
}

/* ===== LARGE DESKTOP OPTIMIZATION (1400px+) ===== */
@media (width >=1400px) {
  section {
    max-width: 1600px;
    margin: 0 auto;
  }

  .home {
    gap: 8rem;
  }

  .skills-grid {
    gap: 3.5rem;
  }

  .projects-container {
    gap: 7rem;
  }

  .contact-container {
    max-width: 1300px;
    padding: 5rem;
  }
}


/* ===== ULTRA WIDE SCREENS (1600px+) ===== */
@media (width >=1600px) {
  section {
    max-width: 1800px;
    margin: 0 auto;
  }

  .contact-container {
    max-width: 1500px;
  }

  .projects-container {
    width: 85%;
    max-width: 1300px;
  }
}

/* Landscape orientation optimizations for mobile and tablets */
@media (orientation: landscape) and (height <=500px) {
  section {
    min-height: auto;
    padding: 2rem clamp(4%, 5%, 9%);
  }
  
  .home {
    gap: 2rem;
    padding-top: 100px;
  }
  
  .home-content h1 {
    font-size: clamp(2.5rem, 4vw, 3rem);
  }
  
  .home-content h3 {
    font-size: clamp(1.8rem, 3vw, 2.2rem);
  }
  
  .home-img img {
    height: 250px;
    width: auto;
  }
  
  .navbar {
    padding: 0.5rem 0;
  }
}

/* Foldable devices and large phones support */
@media (width >=1024px) and (width < 1366px) {
  section {
    padding: 3.5rem clamp(5%, 7%, 9%);
  }
}

/* ============================================================
   COMPREHENSIVE CROSS-PLATFORM & CROSS-DEVICE COMPATIBILITY
   ============================================================ */

/* ==============================================
   1. SAFE AREA & NOTCH SUPPORT (iPhone X+, Android)
   ============================================== */
html {
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

body {
  padding: max(0, env(safe-area-inset-top)) max(0, env(safe-area-inset-right)) max(0, env(safe-area-inset-bottom)) max(0, env(safe-area-inset-left));
}

/* ======================= 
   2. REDUCED MOTION SUPPORT
   ======================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ======================= 
   3. DARK MODE OPTIMIZATION
   ======================== */
@media (prefers-color-scheme: dark) {
  html, body {
    color-scheme: dark;
  }
}

@media (prefers-color-scheme: light) {
  html, body {
    color-scheme: light;
  }
}

/* ======================= 
   4. EXTRA SMALL DEVICES (320px minimum)
   ======================== */
@media (width <=320px) {
  html {
    font-size: 45%;
  }
  
  section {
    padding: 3rem 4% !important;
  }
  
  .navbar {
    padding: 0.4rem 0;
  }
  
  h1, h2, h3 {
    word-break: break-word;
  }
  
  button, .btn {
    font-size: 1.2rem;
    padding: 0.8rem 1.2rem;
  }
}

/* ======================= 
   5. LANDSCAPE ORIENTATION OPTIMIZATIONS (Phone)
   ======================== */
@media (orientation: landscape) and (max-height: 500px) {
  section {
    min-height: auto;
    padding: 2rem 4%;
  }
  
  .home {
    flex-direction: row;
    gap: 2rem;
  }
  
  .home-img img {
    width: 150px;
    height: 150px;
  }
  
  .home-content h1 {
    font-size: 3rem;
  }
  
  .home-content h3 {
    font-size: 1.8rem;
  }
  
  .typing-text {
    font-size: 1.8rem;
  }
  
  .social-icons {
    gap: 1rem;
  }
}

/* ======================= 
   6. LANDSCAPE ORIENTATION (Tablets/Large devices)
   ======================== */
@media (orientation: landscape) and (min-height: 500px) and (max-width: 1024px) {
  section {
    min-height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }
  
  .skills-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
  }
}

/* ======================= 
   7. 4K & ULTRA-HIGH RESOLUTION DISPLAYS
   ======================== */
@media (width >=2560px) and (height >=1440px) {
  html {
    font-size: 70%;
  }
  
  section {
    min-height: 70vh;
    padding: 8rem 12%;
  }
  
  .container {
    max-width: 1600px;
  }
}

/* ======================= 
   8. ENHANCED TOUCH FEEDBACK
   ======================== */
@media (hover: none) and (pointer: coarse) {
  /* Improve touch feedback across all interactive elements */
  button, a, .btn, .nav-link {
    -webkit-tap-highlight-color: rgba(183, 75, 75, 0.2);
    -webkit-touch-callout: none;
  }
  
  .btn:active, button:active, a:active, .nav-link:active {
    opacity: 0.8;
    background-color: rgba(183, 75, 75, 0.1);
  }
  
  /* Better form touch handling */
  input, textarea, select {
    font-size: 16px; /* Prevent zoom on iOS */
    -webkit-appearance: none;
    appearance: none;
    border-radius: 8px;
    padding: 12px;
    min-height: 44px;
  }
}

/* ======================= 
   9. MOUSE/POINTER DEVICE ENHANCEMENTS
   ======================== */
@media (hover: hover) and (pointer: fine) {
  /* Smooth hover transitions on desktop */
  .btn, button, a, .nav-link, .skill-card, .project-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .btn:hover, button:hover {
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(183, 75, 75, 0.25);
  }
}

/* ======================= 
   10. IMPROVED SCROLLING FOR ALL DEVICES
   ======================== */
html {
  scroll-padding-top: 80px;
  -webkit-scroll-behavior: smooth;
  scroll-behavior: smooth;
}

@supports (scroll-behavior: smooth) {
  html {
    scroll-behavior: smooth;
  }
}

/* ======================= 
   11. CROSS-BROWSER VENDOR PREFIXES
   ======================== */
* {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}

/* Firefox specific */
@-moz-document url-prefix() {
  html {
    scroll-behavior: smooth;
  }
}

/* ======================= 
   12. BETTER TEXT RENDERING ACROSS OS
   ======================== */
body, html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  text-rendering: geometricPrecision;
}

/* ======================= 
   13. PREVENT UNWANTED ZOOM ON INPUT FOCUS (iOS)
   ======================== */
@media (max-height: 500px) {
  input, textarea, select, button {
    font-size: 16px !important;
  }
}

/* ======================= 
   14. BETTER FORM SUPPORT ON ALL DEVICES
   ======================== */
input:focus, textarea:focus, select:focus {
  outline: 2px solid #b74b4b;
  outline-offset: 2px;
}

textarea {
  resize: vertical;
  max-height: 250px;
}

/* ======================= 
   15. IMPROVED OVERFLOW HANDLING
   ======================== */
body {
  overflow-x: hidden;
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
}

img, video, iframe {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ======================= 
   16. BETTER EDGE DEVICE SUPPORT (Surface Duo, Foldables)
   ======================== */
@media (screen-spanning: single-fold-vertical) {
  section {
    display: grid;
    grid-template-columns: 100vw 100vw;
  }
}

@media (screen-spanning: single-fold-horizontal) {
  section {
    display: grid;
    grid-template-rows: 100vh 100vh;
  }
}

/* ======================= 
   17. WEBKIT CONSISTENCY (Chrome, Safari, Edge)
   ======================== */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: #0a0a0a;
}

::-webkit-scrollbar-thumb {
  background: #b74b4b;
  border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
  background: #d45555;
}

/* ======================= 
   18. BETTER FOCUS VISIBLE STATE
   ======================== */
:focus-visible {
  outline: 2px solid #b74b4b;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Firefox focus-visible */
:focus:not(:focus-visible) {
  outline: none;
}

/* ======================= 
   19. IMPROVED CONTRAST FOR ACCESSIBILITY
   ======================== */
@media (prefers-contrast: more) {
  * {
    border-width: 2px;
  }
  
  a, button, .btn {
    font-weight: 600;
  }
}

/* ======================= 
   20. VERY LARGE SCREEN OPTIMIZATION (Ultrawide)
   ======================== */
@media (aspect-ratio: 21/9) or (width >=3440px) {
  section {
    max-width: 1800px;
    margin: 0 auto;
  }
  
  .skills-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}
