/* ============================================================
   home-hero.css — Home Hero
   ─────────────────────────────────────────
   PURPOSE : Headline, first step and the decorative iris behind
             them (html-templates/home/hero.html).
   MOTION  : Pure CSS, replays whenever the home route is shown.
             Everything is switched off under prefers-reduced-motion.
   ============================================================ */

.home-hero {
  position: relative;
  /* Above later sections, so the search results can overlap them. */
  z-index: 1;
  isolation: isolate;
  display: flex;
  justify-content: center;
  padding: clamp(48px, 8vw, 96px) 0 clamp(8px, 2vw, 16px);
  text-align: center;
}

/* ── Iris rings ───────────────────────────────────────────────── */
.home-hero__art {
  position: absolute;
  z-index: -1;
  top: clamp(-40px, -3vw, 0px);
  left: 50%;
  width: min(760px, 130vw);
  height: auto;
  translate: -50% 0;
  pointer-events: none;
  /* Fade toward the edge: the outer ring never cuts through the copy below. */
  -webkit-mask-image: radial-gradient(closest-side, #000 58%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 58%, transparent 100%);
  animation: home-art-in 1.3s var(--home-ease) both;
}

.home-hero__ring {
  stroke: var(--border);
  stroke-width: 1.5;
}

.home-hero__tint {
  fill: var(--accent-tint);
  fill-opacity: 0.7;
  animation: home-breathe 7s ease-in-out 1.3s infinite;
}

.home-hero__spin {
  transform-origin: 200px 200px;
  animation: home-spin 120s linear infinite;
}

.home-hero__dash {
  stroke: var(--text-faint);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-dasharray: 1 11;
  opacity: 0.5;
}

.home-hero__dot {
  fill: var(--mark-catch);
}

/* ── Copy ─────────────────────────────────────────────────────── */
.home-hero__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 780px;
}

/* The eyebrow as a quiet pill with the brand's amber catch-light. */
.home-hero .home-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  max-width: 100%;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  font-size: 0.74rem;
  line-height: 1.3;
  text-wrap: balance;
  box-shadow: 0 1px 2px hsl(var(--shadow-color) / 0.05);
}

.home-hero .home-eyebrow::before {
  content: '';
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mark-catch);
  box-shadow: 0 0 0 0 rgb(254 181 54 / 0.55);
  animation: home-ping 2.8s ease-out 1.4s infinite;
}

.home-hero__title {
  margin-top: 18px;
  font-family: 'Fraunces', Georgia, serif;
  font-optical-sizing: auto;
  font-size: clamp(2.15rem, 5.6vw, 4rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.028em;
  color: var(--text);
  text-wrap: balance;
}

/* An amber underline that draws itself under the key phrase. */
.home-hero__title em {
  padding-bottom: 0.04em;
  background: linear-gradient(var(--mark-catch), var(--mark-catch)) no-repeat 0 96% / 0% 0.09em;
  font-style: italic;
  font-weight: 500;
  color: var(--accent);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  animation: home-underline 0.9s var(--home-ease) 0.9s forwards;
}

html[dir="rtl"] .home-hero__title em {
  background-position: 100% 96%;
}

.home-hero__lead {
  max-width: 560px;
  margin-top: 20px;
  font-size: clamp(1rem, 1.7vw, 1.16rem);
  line-height: 1.6;
  color: var(--text-soft);
  text-wrap: pretty;
}

.home-hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 32px;
}

/* ── Entrance ─────────────────────────────────────────────────── */
.home-rise {
  max-width: 100%;
  animation: home-rise 0.85s var(--home-ease) both;
  animation-delay: calc(0.08s + var(--i, 0) * 0.09s);
}

/* The rise wrapper around the search must stay full width. */
.home-hero__content > div.home-rise {
  width: 100%;
  display: flex;
  justify-content: center;
}

@keyframes home-rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

@keyframes home-art-in {
  from { opacity: 0; scale: 0.84; }
  to   { opacity: 1; scale: 1; }
}

@keyframes home-spin {
  to { transform: rotate(360deg); }
}

@keyframes home-breathe {
  0%, 100% { fill-opacity: 0.55; }
  50%      { fill-opacity: 0.9; }
}

@keyframes home-ping {
  0%       { box-shadow: 0 0 0 0 rgb(254 181 54 / 0.55); }
  70%, 100% { box-shadow: 0 0 0 9px rgb(254 181 54 / 0); }
}

@keyframes home-underline {
  to { background-size: 100% 0.09em; }
}

/* ── Arabic ───────────────────────────────────────────────────── */
html[dir="rtl"] .home-hero__title {
  font-family: 'IBM Plex Sans Arabic', 'Tajawal', system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: normal;
}

html[dir="rtl"] .home-hero__title em {
  font-style: normal;
  font-weight: 700;
}

html[dir="rtl"] .home-hero .home-eyebrow {
  font-size: 0.86rem;
}

html[dir="rtl"] .home-hero__lead {
  line-height: 1.85;
}

@media (max-width: 520px) {
  .home-hero {
    padding-top: 36px;
  }

  .home-hero__art {
    top: -24px;
    width: 160vw;
    opacity: 0.8;
  }

  /* Too long for one line: a centred two-line tag without the dot. */
  .home-hero .home-eyebrow {
    justify-content: center;
    padding: 8px 16px;
    border-radius: 16px;
    text-align: center;
  }

  .home-hero .home-eyebrow::before {
    display: none;
  }

  .home-hero__title {
    margin-top: 14px;
    font-size: clamp(1.95rem, 8.6vw, 2.3rem);
  }

  html[dir="rtl"] .home-hero__title {
    line-height: 1.35;
  }

  .home-hero__lead {
    margin-top: 14px;
    font-size: 1rem;
  }

  .home-hero__actions {
    flex-direction: column;
    align-self: stretch;
    gap: 10px;
    margin-top: 26px;
  }

  .home-hero__actions .home-btn {
    min-height: 52px;
    border-radius: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-hero *,
  .home-hero *::before,
  .home-rise {
    animation: none !important;
  }

  .home-hero__title em {
    background-size: 100% 0.09em;
  }
}
