/* =============================================
   HERO
============================================= */
.hero {
  min-height: 100vh;
  background-image: url('../assets/images/Backgrounds/Desktop_Hero_BG.png');
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  /* Fallback gradient if image fails */
  background-color: #c8d9f8;
  position: relative;
  overflow: hidden;
}

/* ── Layout ── */
.hero-layout {
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  gap: clamp(40px, 6vw, 80px);
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 clamp(24px, 6vw, 96px);
  min-height: 100vh;
  position: relative;
  z-index: 2;
}

/* ── Text column ── */
.hero-text {
  flex: 1 1 0;
  max-width: 580px;
  padding-top: clamp(88px, 10vh, 140px);
  padding-bottom: clamp(40px, 6vw, 88px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(14px, 2vw, 24px);
  position: relative;
  z-index: 2;
}

/* ── Headline ── */
.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(24px, calc(8px + 5vw), 80px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0;
  display: flex;
  flex-direction: column;
}

.hero-line-top,
.hero-line-mid {
  display: block;
  color: #ffffff;
  -webkit-text-stroke: 1px rgba(116, 116, 128, 0.08);
  text-stroke: 1px rgba(116, 116, 128, 0.08);
  paint-order: stroke fill;
}

.hero-name {
  display: block;
  color: var(--blue-vivid);
  white-space: nowrap;
}

/* ── Subtitle ── */
.hero-sub {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-mid);
  line-height: 1.5;
  margin: 0;
}

/* ── 40+ Badge ── */
/* Option C — entrance pop (one-time on load) */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(239, 239, 246, 0.92);
  border-radius: var(--radius-pill);
  padding: 4px 20px 4px 4px;
  width: fit-content;
  animation: badgePop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  animation-delay: 0.4s;
}

@keyframes badgePop {
  0%   { transform: scale(0.7); opacity: 0; }
  100% { transform: scale(1);   opacity: 1; }
}

/* Option E — glow ring radiates from circle every 4s */
.badge-count {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: var(--text-dark);
  color: #f8f9fd;
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.04em;
  flex-shrink: 0;
  position: relative;
}

.badge-count::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(93, 127, 219, 0.7);
  animation: badgeRing 4s ease-out infinite;
  animation-delay: 1.2s;
}

@keyframes badgeRing {
  0%   { transform: scale(1);   opacity: 0.7; }
  70%  { transform: scale(1.9); opacity: 0;   }
  100% { transform: scale(1.9); opacity: 0;   }
}

.badge-label {
  font-size: 16px;
  color: var(--text-mid);
  font-weight: 300;
  letter-spacing: -0.02em;
}

/* ── Doctor photo - behind text, right-anchored ── */
.hero-image {
  position: absolute;
  right: clamp(100px, 12vw, 160px);
  bottom: 0;
  z-index: 1;
  width: auto;
  flex: none;
}

.hero-image img {
  /* 80% of viewport height minus navbar (~72px) — aspect ratio preserved */
  height: calc(80vh - 72px);
  width: auto;
  max-width: clamp(340px, 44vw, 660px);
  object-fit: contain;
  object-position: bottom center;
  display: block;
}

/* ── Avatar cluster ── */
/* Desktop: pulled out of flex flow, anchored top-right of hero-layout */
.hero-avatars {
  position: absolute;
  top: clamp(88px, 12vh, 140px);
  right: clamp(24px, 6vw, 96px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.hero-avatars-img {
  width: clamp(120px, 14vw, 180px);
  height: auto;
  object-fit: contain;
  display: block;
  animation: avatarFloat 7s ease-in-out infinite, avatarPulse 4s ease-in-out infinite;
}

@keyframes avatarFloat {
  0%, 100% { transform: translateY(0)    scale(1); }
  50%       { transform: translateY(-8px) scale(1.03); }
}

@keyframes avatarPulse {
  0%, 100% { filter: drop-shadow(0 8px 24px rgba(93, 127, 219, 0.18)); }
  50%       { filter: drop-shadow(0 16px 40px rgba(93, 127, 219, 0.38)); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-avatars-img { animation: none; }
}

.hero-avatars p {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-mid);
  text-align: center;
  max-width: 130px;
  line-height: 1.3;
}

/* ── Scroll hint ── */
.hero-scroll-hint {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  z-index: 2;
  opacity: 0;
  animation: fadeInHint 1s var(--ease-out) 1.4s forwards;
}

.hero-scroll-hint span {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(64, 64, 64, 0.6);
}

.scroll-line {
  width: 1px;
  height: 52px;
  background: linear-gradient(to bottom, var(--blue-vivid), transparent);
  animation: scrollPulse 2.4s var(--ease) infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.35; transform: scaleY(1); }
  50%       { opacity: 1;    transform: scaleY(1.08); }
}

@keyframes fadeInHint {
  to { opacity: 1; }
}

/* ── Spring entrance - page load ── */
@keyframes heroSlideUp {
  from { opacity: 0; transform: translateY(36px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes heroImageSpring {
  from { opacity: 0; transform: translateY(56px) scale(0.94); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* Staggered text cascade */
.hero-line-top {
  opacity: 0;
  animation: heroSlideUp 0.9s cubic-bezier(0.34, 1.4, 0.64, 1) 0.08s forwards;
}

.hero-line-mid {
  opacity: 0;
  animation: heroSlideUp 0.9s cubic-bezier(0.34, 1.4, 0.64, 1) 0.18s forwards;
}

.hero-name {
  opacity: 0;
  animation: heroSlideUp 0.95s cubic-bezier(0.34, 1.52, 0.64, 1) 0.28s forwards;
}

.hero-sub {
  opacity: 0;
  animation: heroSlideUp 0.8s cubic-bezier(0.34, 1.3, 0.64, 1) 0.44s forwards;
}

.hero-badge {
  opacity: 0;
  animation: heroSlideUp 0.8s cubic-bezier(0.34, 1.4, 0.64, 1) 0.54s forwards;
}

.hero-avatars {
  opacity: 0;
  animation: heroSlideUp 0.8s cubic-bezier(0.34, 1.3, 0.64, 1) 0.66s forwards;
}

/* Portrait - slides up from below with scale spring */
.hero-image {
  opacity: 0;
  animation: heroImageSpring 1.2s cubic-bezier(0.34, 1.45, 0.64, 1) 0.22s forwards;
}

/* ── Responsive ── */

@media (max-width: 1024px) {
  .hero {
    background-image: url('../assets/images/Backgrounds/Mobile_Hero_BG.png');
    background-position: center top;
    min-height: 100svh;
  }

  .hero-layout {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 88px 24px 0;
    min-height: 100svh;
    gap: 0;
    /* Image will be absolute so layout stays as column for text */
    position: relative;
  }

  .hero-text {
    flex: 0 0 auto;
    justify-content: flex-start;
    padding-bottom: 0;
    gap: 14px;
    padding-top: 0;
    position: relative;
    z-index: 2;
    max-width: 100%;
  }

  .badge-count {
    width: 28px;
    height: 28px;
    font-size: 13px;
  }

  .badge-label {
    font-size: 13px;
  }

  .hero-badge {
    padding: 3px 14px 3px 3px;
    gap: 6px;
  }

  /* Doctor: 80% viewport height, anchored to bottom */
  .hero-image {
    right: 0;
    bottom: 0;
    top: auto;
    height: 80svh;
    width: auto;
    z-index: 0;
  }

  .hero-image img {
    height: 100%;
    width: auto;
    object-fit: contain;
    object-position: bottom center;
    display: block;
  }

  .hero-avatars p {
    font-size: 12px;
    max-width: 90px;
  }

  .hero-badge {
    align-self: flex-start;
  }

  /* Mobile: natural flex item in hero-layout column, left-aligned below badge */
  .hero-avatars {
    position: static;
    margin-top: 20px;
  }

  .hero-scroll-hint {
    display: none;
  }
}

@media (max-width: 360px) {
  .hero-avatars p {
    font-size: 10px;
    max-width: 72px;
  }

  .badge-label {
    font-size: 10px;
  }

  .badge-count {
    width: 24px;
    height: 24px;
    font-size: 11px;
  }
}

/* ── Desktop 1440px+ ── */
@media (min-width: 1440px) {
  .hero-sub {
    font-size: 24px;
  }

  .hero-text {
    padding-top: 80px;
    padding-bottom: 80px;
  }

  .hero-avatars {
    top: calc(clamp(88px, 12vh, 140px) + 200px);
  }
}
