/* ════════════════════════════════════════════════
   05 — HERO
   Cinematic full-bleed hero with portrait + Arabic logo
   overlay, name, 3 pillars, scroll cue, floating tweet
   ════════════════════════════════════════════════ */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--maroon);
  isolation: isolate;
}

/* Maroon brand tint over the ambient background video — translucent on all
   viewports now that the video plays on desktop too. Keeps text contrast high
   without hiding the footage. */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at center 40%,
    rgba(108, 26, 49, 0.45) 0%,
    rgba(58, 14, 26, 0.65) 50%,
    rgba(38, 8, 18, 0.85) 100%
  );
  z-index: -2;
}

/* Ambient background video — shown on every viewport. main.js swaps in the
   landscape desktop encode on wide screens and the portrait encode on mobile,
   and strips the source entirely for reduced-motion / Save-Data users. */
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: -3;
  display: block;
  pointer-events: none;
  /* Prevents brief flash of black before poster paints */
  background: var(--maroon-deep) center/cover no-repeat;
}

/* Subtle film grain noise */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: -1;
  opacity: 0.6;
  mix-blend-mode: overlay;
}

.hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 80px 32px 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
  animation: heroFadeIn 1.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Portrait + Arabic logo composite */
.hero-composite {
  position: relative;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  /* Hidden on all viewports — the ambient video is the hero centerpiece now.
     (The portrait/logo composite markup stays for non-JS/poster fallback.) */
  display: none;
  align-items: center;
  justify-content: center;
}
.hero-composite__portrait {
  display: block;
  max-height: 68vh;
  width: auto;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  /* Cinematic film grade via CSS */
  filter: contrast(1.04) saturate(1.06);
  animation: heroPortraitScale 22s ease-in-out infinite alternate;
}
.hero-composite__logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  /* New long-name logo has aspect 3.4:1 (vs old short-name 5:1) — at the
     prior 92% width it became a chunky block over the portrait. 68% keeps it
     a readable signature centered over the chest without dominating. */
  width: 68%;
  height: auto;
  z-index: 2;
  opacity: 0.97;
  pointer-events: none;
  /* drop shadow for depth */
  filter: drop-shadow(0 4px 24px rgba(0, 0, 0, 0.35));
}

/* Eyebrow above the portrait — italic Latin title accent */
.hero-eyebrow {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(13px, 1.15vw, 17px);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cream);
  opacity: 0.78;
  margin-bottom: 0;
}
.hero-eyebrow em { font-style: normal; color: var(--olive-gold); }

/* Pillar nav under the portrait/logo */
.hero-pillars {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
  margin-top: 8px;
}
.hero-pillars a {
  font-family: var(--font-arabic);
  font-weight: 400;
  font-size: clamp(15px, 1.4vw, 19px);
  color: var(--cream);
  opacity: 0.92;
  position: relative;
  padding: 8px 28px;
  transition: opacity 0.3s ease, color 0.3s ease;
}
.hero-pillars a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 30px;
  height: 1px;
  background: var(--olive-gold);
  transition: transform 0.4s ease;
}
.hero-pillars a:hover,
.hero-pillars a.active { color: var(--olive-gold); opacity: 1; }
.hero-pillars a:hover::after,
.hero-pillars a.active::after { transform: translateX(-50%) scaleX(1); }
.hero-pillars .pillar-sep {
  color: var(--olive-gold);
  opacity: 0.3;
  font-family: var(--font-serif);
  font-size: 14px;
}

/* Floating quote card (bottom-leading edge) */
.hero-quote {
  position: absolute;
  bottom: 56px;
  inset-inline-end: 56px;
  width: 340px;
  padding: 28px 28px 22px;
  background: rgba(8, 10, 14, 0.45);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(184, 168, 124, 0.18);
  z-index: 3;
  animation: heroFadeIn 1.6s 0.7s both ease-out;
}
.hero-quote__mark {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 56px;
  line-height: 0.5;
  color: var(--olive-gold);
  opacity: 0.6;
  display: block;
  margin-bottom: 8px;
}
.hero-quote__body {
  font-family: var(--font-arabic);
  font-size: 16px;
  line-height: 1.75;
  color: var(--cream);
  font-weight: 300;
  letter-spacing: -0.005em;
}
.hero-quote__attribution {
  font-family: var(--font-serif);
  /* Renders Arabic ("— خ. ع") — no italic since the font file has no italic
     axis and Arabic doesn't have a true italic counterpart. */
  font-style: normal;
  font-size: 13px;
  color: var(--olive-gold);
  margin-top: 14px;
  letter-spacing: 0.04em;
}

/* Scroll cue.
   Centered via inset-inline + margin-inline auto instead of
   left:50% + transform:translateX(-50%) because the heroFadeIn animation
   ends with transform:translateY(0), which would otherwise wipe out the
   horizontal translate and leave the element off-center. */
.hero-scroll {
  position: absolute;
  bottom: 32px;
  inset-inline: 0;
  margin-inline: auto;
  width: fit-content;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  z-index: 3;
  opacity: 0.6;
  animation: heroFadeIn 1.6s 1s both ease-out;
}
.hero-scroll__label {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 11px;
  color: var(--cream);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.hero-scroll__chevron {
  width: 1px;
  height: 36px;
  background: linear-gradient(to bottom, transparent, var(--olive-gold));
  position: relative;
}
.hero-scroll__chevron::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  width: 6px;
  height: 6px;
  border-bottom: 1px solid var(--olive-gold);
  border-inline-end: 1px solid var(--olive-gold);
  transform: translateX(-50%) rotate(45deg);
  animation: scrollBounce 2.4s ease-in-out infinite;
}

@keyframes heroFadeIn {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes heroPortraitScale {
  0%   { transform: scale(1); }
  100% { transform: scale(1.04); }
}
@keyframes scrollBounce {
  0%, 20%   { transform: translateX(-50%) translateY(0) rotate(45deg); opacity: 1; }
  60%       { transform: translateX(-50%) translateY(8px) rotate(45deg); opacity: 0.3; }
  100%      { transform: translateX(-50%) translateY(0) rotate(45deg); opacity: 1; }
}

/* Responsive */
@media (max-width: 1024px) {
  .hero-quote { display: none; }
}
/* Soft text shadow so the cream copy stays legible over the moving footage —
   applies on all viewports now that the video is universal. */
.hero-eyebrow,
.hero-pillars a,
.hero-pillars .pillar-sep,
.hero-scroll__label {
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.45);
}

@media (max-width: 768px) {
  .hero-pillars a { padding: 6px 16px; }
  .hero-pillars { flex-wrap: wrap; gap: 0; }
  .hero-scroll { bottom: 16px; }

  /* Without the composite, give the eyebrow more presence as the visual anchor */
  .hero-eyebrow { font-size: clamp(13px, 3.4vw, 17px); }
}
@media (max-width: 480px) {
  .hero-pillars { flex-direction: row; gap: 4px; }
  .hero-pillars a { font-size: 13px; padding: 6px 10px; }
  .hero-pillars .pillar-sep { display: none; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .hero-composite__portrait,
  .hero-scroll__chevron::after { animation: none; }
}
