/* ==========================================================================
   Al Handasia for Exhausts — custom styles (things Tailwind can't do)
   ========================================================================== */

:root {
  --red: #d90f1c;
  --red-dark: #a80812;
  --ink: #111317;
  --mist: #f6f7f9;
  --container-width: 1400px;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

/* ---------- Shared components ---------- */
.container-site {
  width: 100%;
  max-width: var(--container-width);
  margin-inline: auto;
  padding-inline: 1rem;
}

.btn-red,
.btn-ghost {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  padding: 0.85rem 2.4rem;
  color: #fff;
  font-weight: 800;
  transition: transform 0.25s;
}
.btn-red::after,
.btn-ghost::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 0.7rem;
  transform: skewX(-18deg);
  transition: border-color 0.25s;
}
.btn-red::after {
  background: linear-gradient(135deg, #e8141f, var(--red-dark));
}
/* الشرطتين المائلتين */
.btn-red::before {
  content: "";
  position: absolute;
  left: -1.3rem;
  top: 50%;
  z-index: -1;
  width: 0.7rem;
  height: 62%;
  background: linear-gradient(
    90deg,
    var(--red) 0 36%,
    transparent 36% 64%,
    var(--red) 64%
  );
  transform: translateY(-50%) skewX(-18deg);
}
.btn-red:hover {
  transform: translateY(-2px);
}

.btn-ghost::after {
  border: 2px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.06);
}
.btn-ghost:hover::after {
  border-color: var(--red);
}

.card-soft {
  background: linear-gradient(180deg, #fff, #f3f4f6);
  border: 1px solid #eef0f3;
  border-radius: 1rem;
  box-shadow: 0 14px 34px -16px rgba(17, 19, 23, 0.25);
}

.card-img {
  width: 100%;
  height: 9.5rem;
  padding: 0.75rem;
  object-fit: contain;
  mix-blend-mode: multiply;
}
.card-img-cover {
  padding: 0;
  object-fit: cover;
  mix-blend-mode: normal;
}

.round-red {
  display: grid;
  place-items: center;
  flex: none;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 0.65rem;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  margin-bottom: 2rem;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 800;
}
.section-title::before,
.section-title::after {
  content: "";
  width: clamp(2.5rem, 20vw, 15rem);
  height: 2px;
}
.section-title::before {
  background: linear-gradient(90deg, transparent, var(--red));
}
.section-title::after {
  background: linear-gradient(270deg, transparent, var(--red));
}

.nav-link {
  transition: color 0.2s;
}
.nav-link:hover {
  color: var(--red);
}
.mobile-link {
  padding: 0.75rem 0;
  border-bottom: 1px solid #f1f2f4;
}

.social-btn {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  transition: background 0.25s;
}
.social-btn:hover {
  background: var(--red);
}

/* ---------- Hero (necessary only: swiper-generated states + animations) ---------- */
.swiper-slide-active .hero-bg {
  animation: kenburns 9s ease-out both;
}

/* masked text reveal: hidden state + animation live together here */
.reveal > span {
  transform: translateY(115%);
}
.swiper-slide-active .reveal > span {
  animation: rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: var(--d);
}

/* buttons: fade + slide (no overflow mask, so nothing peeks out) */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
}
.swiper-slide-active .fade-up {
  animation: fadeUp 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: var(--d);
}

.hero-wipe.is-running {
  animation: wipe 0.95s cubic-bezier(0.77, 0, 0.18, 1);
}

.hero-bullet {
  position: relative;
  width: 2.75rem;
  height: 4px;
  overflow: hidden;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
}
.hero-bullet.is-active::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--red);
  transform-origin: right;
  animation: bulletFill 6s linear forwards;
}

/* ---------- Scroll reveal (.fx) ---------- */
.fx {
  opacity: 0;
  transform: translateY(40px);
  transition:
    opacity 0.8s ease,
    transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
  transition-delay: var(--d, 0s);
}
.fx[data-from="left"] {
  transform: translateX(-70px);
}
.fx[data-from="right"] {
  transform: translateX(70px);
}
.fx.is-in {
  opacity: 1;
  transform: none;
}

/* ---------- About section ---------- */
.about-sec {
  background: #fff;
}
.about-grid {
  display: grid;
  align-items: center;
  gap: 3rem 1.5rem;
}
@media (min-width: 1024px) {
  .about-grid {
    grid-template-columns: minmax(0, 38fr) minmax(0, 62fr);
  }
}

.about-gear {
  position: absolute;
  z-index: 0;
  color: #e5e6e9;
  line-height: 1;
  pointer-events: none;
}
.about-gear i {
  display: block;
  animation: aboutSpin 45s linear infinite;
}
.about-gear-top {
  top: calc(-1 * min(3vw, 3rem));
  left: calc(25.5% - min(11.5vw, 12rem));
  font-size: min(23vw, 24rem);
}
.about-gear-bottom {
  bottom: calc(-1 * min(11vw, 11rem));
  left: calc(53% - min(10.5vw, 11rem));
  font-size: min(21vw, 22rem);
}
.about-gear-bottom i {
  animation-direction: reverse;
}

.about-corner {
  position: absolute;
  z-index: 0;
  display: none;
  pointer-events: none;
  background: linear-gradient(135deg, #ee1a26, var(--red-dark));
}
@media (min-width: 1024px) {
  .about-corner {
    display: block;
  }
}
.about-corner-a {
  top: 0;
  left: 0;
  width: 7.6vw;
  height: 11.7vw;
  clip-path: polygon(0 0, 100% 0, 0 100%);
}
.about-corner-b {
  top: 0;
  left: 2.8vw;
  width: 8.9vw;
  height: 8.9vw;
  clip-path: polygon(65% 0, 100% 0, 35% 100%, 0 100%);
}
.about-corner-c {
  bottom: 0;
  left: 0;
  width: 10.6vw;
  height: 7vw;
  clip-path: polygon(0 0, 100% 100%, 0 100%);
}

.about-stage {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 56rem;
  margin-inline: auto;
  aspect-ratio: 850 / 665;
  container-type: inline-size;
  direction: ltr;
}

.about-card {
  position: absolute;
  z-index: var(--z, 1);
  overflow: hidden;
  direction: rtl;
  cursor: pointer;
  background: var(--ink);
  border: max(3px, 0.55cqw) solid #fff;
  border-radius: 3.3cqw;
  box-shadow: 0 2.5cqw 4cqw -1.8cqw rgba(17, 19, 23, 0.5);
  transform: skew(var(--sx), var(--sy));
  transition:
    transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.7s;
}
.about-card[data-active="true"] {
  z-index: 20;
  transform: skew(var(--sx), var(--sy)) translateY(-1.2cqw) scale(1.04);
  box-shadow: 0 4cqw 5cqw -2cqw rgba(17, 19, 23, 0.6);
}
.about-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s;
}
.about-card:hover img {
  transform: scale(1.05);
}
.about-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    0deg,
    rgba(10, 12, 15, 0.88) 0,
    rgba(10, 12, 15, 0.3) 32%,
    transparent 58%
  );
}
.about-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(17, 19, 23, 0.14);
  pointer-events: none;
  transition: opacity 0.7s;
}
.about-card[data-active="true"]::after {
  opacity: 0;
}

.about-num {
  position: absolute;
  z-index: 2;
  top: 2.6cqw;
  left: 3.4cqw;
  font-size: max(1.8rem, 7.3cqw);
  font-weight: 900;
  line-height: 1;
  color: rgba(255, 255, 255, 0.45);
}
.about-label {
  position: absolute;
  z-index: 2;
  inset-inline: 0;
  bottom: 2.8cqw;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.6cqw;
}
.about-label-text {
  font-size: max(0.8rem, 3.1cqw);
  font-weight: 800;
  color: #fff;
}
.about-label-ico {
  display: grid;
  flex: none;
  place-items: center;
  width: max(2rem, 6.1cqw);
  height: max(2rem, 6.1cqw);
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: max(0.8rem, 2.6cqw);
}

.about-badge {
  position: absolute;
  z-index: 30;
  left: 5.3%;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 2cqw;
  padding: 1.6cqw 3cqw 1.6cqw 2.2cqw;
  direction: rtl;
  background: #fff;
  border-radius: 3cqw;
  box-shadow: 0 2.5cqw 5cqw -2cqw rgba(17, 19, 23, 0.45);
  transform: rotate(-3deg);
  animation: aboutFloat 4.5s ease-in-out infinite;
}
.about-badge-text {
  display: block;
  font-size: max(0.8rem, 2.6cqw);
  font-weight: 800;
  line-height: 1.2;
}
.about-badge-num {
  display: block;
  font-size: max(1.4rem, 5.9cqw);
  font-weight: 900;
  font-style: italic;
  line-height: 1.05;
  color: var(--red);
}
.about-badge-line {
  display: block;
  width: 100%;
  height: 1.1cqw;
  color: var(--red);
}
.about-gem {
  display: grid;
  flex: none;
  place-items: center;
  width: 6cqw;
  height: 6cqw;
  margin-inline: 1.2cqw;
  border-radius: 1.5cqw;
  background: linear-gradient(135deg, #ee1a26, var(--red-dark));
  color: #fff;
  font-size: 3.1cqw;
  transform: rotate(45deg);
}
.about-gem i {
  transform: rotate(-45deg);
}

/* ---------- Videos slider  ---------- */
.vid-card {
  position: relative;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border-radius: 1.4rem;
  background: #0b0c0f;
  box-shadow: 0 18px 40px -24px rgba(17, 19, 23, 0.55);
  transition:
    transform 0.4s,
    box-shadow 0.4s;
}
.vid-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 26px 46px -24px rgba(217, 15, 28, 0.5);
}
.vid-card > i {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 3.5rem;
  color: rgba(255, 255, 255, 0.14);
  animation: vidPulse 1.4s ease-in-out infinite;
}
.vid-card iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

/* ---------- Keyframes ---------- */
@keyframes wipe {
  from {
    transform: translateX(110%);
  }
  to {
    transform: translateX(-110%);
  }
}
@keyframes rise {
  from {
    transform: translateY(115%);
  }
  to {
    transform: translateY(0);
  }
}
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes kenburns {
  from {
    transform: scale(1.18);
  }
  to {
    transform: scale(1);
  }
}
@keyframes smokeRise {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0.6);
  }
  25% {
    opacity: 0.85;
  }
  100% {
    opacity: 0;
    transform: translate(40px, -340px) scale(1.7);
  }
}
@keyframes bulletFill {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}
@keyframes aboutSpin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes aboutFloat {
  0%,
  100% {
    transform: rotate(-3deg) translateY(0);
  }
  50% {
    transform: rotate(-3deg) translateY(-10px);
  }
}
@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-14px);
  }
}
@keyframes vidPulse {
  50% {
    opacity: 0.4;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal > span {
    transform: none;
  }
  .fade-up {
    opacity: 1;
    transform: none;
  }
  .swiper-slide-active .reveal > span,
  .swiper-slide-active .fade-up,
  .swiper-slide-active .hero-bg,
  .hero-wipe.is-running {
    animation: none;
  }
  .fx {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .about-card {
    transition: none;
  }
  .about-gear i,
  .about-badge {
    animation: none;
  }
}
/* ==========================================================================
   Gallery 
   ========================================================================== */

.gal-band {
  position: relative;
  overflow: hidden;
  padding: 3.5rem 0 2.5rem;
  background:
    radial-gradient(60% 80% at 50% 0%, #1d2026 0%, transparent 70%),
    linear-gradient(180deg, #0b0c0f, #14161b 60%, #0b0c0f);
  clip-path: polygon(
    0 4.5rem,
    29% 4.5rem,
    33% 0,
    67% 0,
    71% 4.5rem,
    100% 4.5rem,
    100% 100%,
    0 100%
  );
  padding-top: 7rem;
}
@media (max-width: 767px) {
  .gal-band {
    clip-path: polygon(
      0 3.5rem,
      12% 3.5rem,
      20% 0,
      80% 0,
      88% 3.5rem,
      100% 3.5rem,
      100% 100%,
      0 100%
    );
    padding-top: 6rem;
  }
}

.gal-wing {
  position: absolute;
  top: 4.5rem;
  z-index: 2;
  width: 26%;
  height: 5px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--red) 40%,
    var(--red-dark)
  );
  box-shadow: 0 0 22px 2px rgba(217, 15, 28, 0.55);
}
.gal-wing-r {
  right: 0;
  transform: scaleX(-1);
  transform-origin: center;
}
.gal-wing-l {
  left: 0;
}
@media (max-width: 767px) {
  .gal-wing {
    top: 3.5rem;
    width: 12%;
  }
}

.gal-glow {
  position: absolute;
  inset: auto 0 -40% 0;
  height: 70%;
  background: radial-gradient(
    50% 60% at 50% 100%,
    rgba(217, 15, 28, 0.22),
    transparent 70%
  );
  pointer-events: none;
}

.gal-head {
  position: absolute;
  top: -4.4rem;
  inset-inline: 0;
  text-align: center;
}
@media (max-width: 767px) {
  .gal-head {
    top: -3.7rem;
  }
}

.gal-card {
  --rx: 0deg;
  --ry: 0deg;
  --mx: 50%;
  --my: 50%;
  position: relative;
  display: block;
  aspect-ratio: 4 / 3.1;
  overflow: hidden;
  cursor: zoom-in;
  background: #000;
  border: 3px solid rgba(255, 255, 255, 0.9);
  border-radius: 1.4rem;
  box-shadow: 0 22px 40px -22px rgba(0, 0, 0, 0.9);
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));
  transition:
    transform 0.25s ease-out,
    box-shadow 0.4s,
    border-color 0.4s;
  will-change: transform;
}
.gal-card:hover {
  border-color: var(--red);
  box-shadow:
    0 28px 46px -22px rgba(217, 15, 28, 0.55),
    0 0 0 1px rgba(217, 15, 28, 0.4);
}
.gal-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.gal-card:hover img {
  transform: scale(1.12);
}

/* لمعة بتتحرك مع الماوس */
.gal-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: radial-gradient(
    260px circle at var(--mx) var(--my),
    rgba(255, 255, 255, 0.28),
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.gal-card:hover::before {
  opacity: 1;
}

.gal-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    0deg,
    rgba(8, 9, 12, 0.9) 0,
    rgba(8, 9, 12, 0.25) 38%,
    transparent 62%
  );
  pointer-events: none;
}

.gal-num {
  position: absolute;
  z-index: 3;
  top: 0.6rem;
  left: 0.9rem;
  font-size: 2.2rem;
  font-weight: 900;
  line-height: 1;
  color: rgba(255, 255, 255, 0.4);
}

.gal-zoom {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 3.6rem;
  height: 3.6rem;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 1.2rem;
  box-shadow: 0 0 0 0.4rem rgba(217, 15, 28, 0.3);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.4);
  transition:
    opacity 0.35s,
    transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1.4);
}
.gal-card:hover .gal-zoom {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.gal-cap {
  position: absolute;
  z-index: 3;
  inset-inline: 0;
  bottom: 0;
  padding: 0.9rem 1rem;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 800;
  color: #fff;
  transform: translateY(100%);
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.gal-cap::before {
  content: "";
  display: block;
  width: 2.2rem;
  height: 3px;
  margin: 0 auto 0.5rem;
  border-radius: 9999px;
  background: var(--red);
}
.gal-card:hover .gal-cap {
  transform: none;
}

.gal-arrow {
  position: absolute;
  top: 50%;
  z-index: 20;
  display: grid;
  place-items: center;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  font-size: 0.85rem;
  box-shadow: 0 10px 24px -8px rgba(0, 0, 0, 0.7);
  transform: translateY(-60%);
  transition:
    background 0.25s,
    color 0.25s,
    transform 0.25s;
}
.gal-arrow:hover {
  background: var(--red);
  color: #fff;
  transform: translateY(-60%) scale(1.1);
}
.gal-arrow-prev {
  right: -0.4rem;
}
.gal-arrow-next {
  left: -0.4rem;
}
.gal-arrow.swiper-button-disabled {
  opacity: 0.35;
  pointer-events: none;
}
@media (min-width: 1500px) {
  .gal-arrow-prev {
    right: -1.4rem;
  }
  .gal-arrow-next {
    left: -1.4rem;
  }
}

.gal-dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 9999px;
  background: #fff;
  cursor: pointer;
  opacity: 0.9;
  transition:
    width 0.35s,
    background 0.35s;
}
.gal-dot.is-active {
  width: 2rem;
  background: var(--red);
}

/* ---------- Fancybox بألوان الموقع ---------- */
.fancybox__container {
  --fancybox-bg: rgba(8, 9, 12, 0.94);
  --f-button-hover-bg: var(--red);
  --f-button-active-bg: var(--red-dark);
  --f-spinner-color-1: var(--red);
  --f-thumb-selected-color: var(--red);
  font-family: "Cairo", sans-serif;
}
.fancybox__caption {
  font-weight: 800;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .gal-card,
  .gal-card img,
  .gal-zoom,
  .gal-cap {
    transition: none;
  }
}
