@media (max-width: 768px) {
  .section-grid {
    flex-direction: column;
    align-items: center;
  }

  .section-grid .section {
    flex: 1 1 100% !important;
    max-width: 90% !important;
  }

  .carousel {
    max-width: 100% !important;
  }

  .carousel-inner img {
    object-fit: cover;
  }

  h1.title {
    font-size: 2.2rem !important;
  }

  .fixed-logo {
    width: 40px !important;
  }

  nav {
    flex-wrap: wrap !important;
    padding: 0.5rem !important;
    gap: 0.5rem !important;
  }

  .section {
    flex: 1 1 calc(50% - 1.5rem);
    max-width: calc(50% - 1.5rem);
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Vazirmatn', sans-serif;
  scroll-behavior: smooth;
}

body {
  background: linear-gradient(135deg, #0a2342, #1e3c72);
  color: #fff;
  overflow-x: hidden;
}

.hero {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem;
  animation: fadeSlideIn 1.5s ease-out;
}

h1.title {
  font-size: 4rem;
  color: #CBA135;
  margin-bottom: 1rem;
  animation: popIn 1.5s ease forwards;
}

.carousel {
  width: 90%;
  max-width: 600px;
  aspect-ratio: 16/9;
  margin-top: 2rem;
  perspective: 1200px;
}

.carousel-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  animation: rotateCube 20s infinite linear;
}

.carousel-inner img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  backface-visibility: hidden;
  border-radius: 1rem;
}

.carousel-inner img:nth-child(1) { transform: rotateY(0deg) translateZ(300px); }
.carousel-inner img:nth-child(2) { transform: rotateY(90deg) translateZ(300px); }
.carousel-inner img:nth-child(3) { transform: rotateY(180deg) translateZ(300px); }
.carousel-inner img:nth-child(4) { transform: rotateY(270deg) translateZ(300px); }

@keyframes rotateCube {
  from { transform: rotateY(0deg); }
  to { transform: rotateY(360deg); }
}

@keyframes fadeSlideIn {
  0% { opacity: 0; transform: translateY(50px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes popIn {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.section-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  margin: 2rem auto;
  max-width: 1200px;
}

.section {
  background-color: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border-radius: 1rem;
  padding: 2rem;
  color: #DFF6FF;
  cursor: pointer;
  transition: background 0.3s;
  width: 100%;
  max-width: 560px;
  min-height: 320px;
  box-shadow: 0 0 10px rgba(0,0,0,0.3);
  flex: 1 1 calc(50% - 1.5rem);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.section:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.section h2 {
  font-size: 1.8rem;
  color: #CBA135;
  margin-bottom: 1rem;
  transition: opacity 0.5s ease, transform 0.5s ease;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.section.active h2 {
  opacity: 0;
  transform: translate(-50%, -60%);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.section p, .section ul {
  display: none;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.section.active p,
.section.active ul {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.btn {
  background-color: #CBA135;
  color: #0A2342;
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: 0.3s;
  text-decoration: none;
}

.btn:hover {
  background-color: #d5af4f;
}

.burger {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}

.burger span {
  width: 30px;
  height: 4px;
  background: white;
  border-radius: 2px;
}

.burger.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.burger.open span:nth-child(2) {
  transform: scaleX(0);
}

.burger.open span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

.menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 250px;
  height: 100vh;
  background: rgba(10, 35, 66, 0.95);
  padding: 2rem;
  transition: right 0.4s ease;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  z-index: 998;
}

.menu.show {
  right: 0;
}

.menu a {
  color: #fff;
  text-decoration: none;
  font-size: 1.2rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.lang-toggle {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 999;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  background-color: rgba(203, 161, 53, 0.9);
  box-shadow: 0 0 5px rgba(0,0,0,0.3);
  border: none;
  border-radius: 5px;
}

html[lang="fa"] .lang-en { display: none; }
html[lang="en"] .lang-fa { display: none; }
