/*
==================================================
===================== HERO ======================
==================================================
 Main hero section with animated title, buttons, and decorative icons

Table of Content (Hero):
0. Hero Wrapper
1. Hero Container
2. Text Content
   2.1 Title
   2.2 Subtitle
   2.3 Description
3. Hero Actions (Buttons)
4. Hero Images Grid
   4.1 Avatar
   4.2 Big Gear
   4.3 Small Gear
   4.4 Code Icon
5. Animations
6. Responsive Design
   6.1 320px
   6.2 375px
   6.3 425px
   6.4 768px
==================================================
*/

/* ============================================
   0. HERO WRAPPER
============================================ */
.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  max-height: calc(100vh - 60px);
}

/* ============================================
   1. HERO CONTAINER
============================================ */
.hero .container {
  max-width: 768px;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xxl);
}

/* ============================================
   2. TEXT CONTENT
============================================ */
.hero__content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* -------- 2.1 Title -------- */
.hero__title {
  font-family: var(--font-family-heading);
  font-weight: var(--font-weight-extrabold);
  color: var(--color-text-inverse);
  text-transform: capitalize;
  width: fit-content;
  position: relative;
}

/* Title typing animation */
.hero__title::before {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 100%;
  color: var(--color-primary, #00d8ff);
  border-right: 3px solid var(--color-primary, #00d8ff);
  white-space: nowrap;
  overflow: hidden;
  text-shadow: 0 0 25px rgba(255, 255, 222, 0.7);
  animation: ani 8s linear infinite;
}

/* RTL correction */
html[dir="rtl"] .hero__title::before {
  left: auto;
  right: 0;
  border-right: none;
  border-left: 3px solid var(--color-primary, #00d8ff);
}

/* -------- 2.2 Subtitle -------- */
.hero__subtitle {
  font-family: var(--font-family-heading);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-inverse);
  text-transform: capitalize;
}

/* -------- 2.3 Description -------- */
.hero__description {
  color: var(--color-text-inverse);
  padding: 0 var(--spacing-sm);
  text-align: center;
  text-transform: capitalize;
}

/* ============================================
   3. HERO ACTIONS (BUTTONS)
============================================ */
.hero__actions {
  display: flex;
  justify-content: flex-start;
  gap: var(--spacing-sm);
}

.hero__btn {
  padding: var(--spacing-sm);
  border-radius: var(--radius-md);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: var(--transition-normal);
}

.hero__btn--primary {
  background-color: var(--color-primary);
  color: var(--color-text-inverse);
}

.hero__btn--secondary {
  background-color: var(--color-bg-light);
  color: var(--color-primary);
}

.hero__btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

/* ============================================
   4. HERO IMAGES GRID
============================================ */
.hero__images {
  direction: ltr !important;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: repeat(3, 1fr);
  grid-template-areas:
    ". gearl gearl gearl avatar avatar avatar"
    ". gearl gearl gearl avatar avatar avatar"
    ". gears code . avatar avatar avatar";
  position: relative;
  animation: fadeSlideIn var(--transition-slow);
}

/* -------- 4.1 Avatar -------- */
.hero__avatar {
  grid-area: avatar;
  position: absolute;
  top: -35%;
  right: -8%;
}

/* -------- 4.2 Big Gear -------- */
.hero__gear--big {
  grid-area: gearl;
  align-self: center;
  justify-self: center;
  animation: spin 15s linear infinite;
}

/* -------- 4.3 Small Gear -------- */
.hero__gear--small {
  grid-area: gears;
  position: absolute;
  top: -30%;
  animation: spinReverse 15s linear infinite;
}

/* -------- 4.4 Code Icon -------- */
.hero__code {
  grid-area: code;
  justify-self: end;
  position: absolute;
  right: -200%;
  top: -100%;
}

/* ============================================
   5. ANIMATIONS
============================================ */
@keyframes ani {

  0%,
  70% {
    width: 0;
  }

  50%,
  100% {
    width: 100%;
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes spinReverse {
  from {
    transform: rotate(360deg);
  }

  to {
    transform: rotate(0deg);
  }
}

/* ============================================
   6. RESPONSIVE DESIGN
============================================ */

/* -------- 6.1 Phones (max 320px) -------- */
@media (max-width: 320px) {
  .hero__title {
    font-size: 1.6rem;
  }

  .hero__subtitle {
    font-size: 1.1rem;
  }

  .hero__description {
    font-size: 0.8rem;
  }

  .hero__avatar {
    width: 150px;
  }

  .hero__gear--big {
    width: 55px;
  }

  .hero__gear--small {
    width: 40px;
  }

  .hero__code {
    width: 40px;
  }

  .hero__btn {
    font-size: 0.75rem;
  }
}

/* -------- 6.2 Phones (321px–375px) -------- */
@media (min-width: 321px) and (max-width: 375px) {
  .hero__title {
    font-size: 1.8rem;
  }

  .hero__subtitle {
    font-size: 1rem;
  }

  .hero__description {
    font-size: 0.85rem;
  }

  .hero__avatar {
    width: 170px;
  }

  .hero__gear--big {
    width: 65px;
  }

  .hero__gear--small {
    width: 45px;
  }

  .hero__code {
    width: 45px;
  }

  .hero__btn {
    font-size: 0.8rem;
  }
}

/* -------- 6.3 Phones (376px–767px) -------- */
@media (min-width: 376px) and (max-width: 767px) {
  .hero__title {
    font-size: 2rem;
  }

  .hero__subtitle {
    font-size: 1.3rem;
  }

  .hero__description {
    font-size: 0.9rem;
  }

  .hero__avatar {
    width: 200px;
  }

  .hero__gear--big {
    width: 75px;
  }

  .hero__gear--small {
    width: 55px;
  }

  .hero__code {
    width: 50px;
  }

  .hero__btn {
    font-size: 0.85rem;
  }
}

/* -------- 6.4 Tablets (≥768px) -------- */
@media (min-width: 768px) {
  .hero__title {
    font-size: 3rem;
  }

  .hero__subtitle {
    font-size: 1.8rem;
  }

  .hero__description {
    font-size: 1rem;
  }

  .hero__avatar {
    width: 260px;
    top: -60%;
  }

  .hero__gear--big {
    width: 100px;
  }

  .hero__gear--small {
    width: 80px;
  }

  .hero__code {
    width: 60px;
  }

  .hero__btn {
    font-size: 1rem;
  }
}