/* Responsive and Custom Styling Overrides for A&M Advisory */

@media (max-width: 640px) {
  .hero-title {
    font-size: 2.25rem;
    line-height: 2.5rem;
  }
}

@media (max-width: 768px) {
  .mobile-menu-open {
    overflow: hidden;
  }

  #mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 110;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #0f1f5c;
  }
}

/* Custom Animation Utilities */
@keyframes pulseGlow {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

.animate-pulse-glow {
  animation: pulseGlow 2.5s infinite ease-in-out;
}

/* Client Logos Marquee Animation */
@keyframes scrollMarquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.animate-scroll {
  display: flex;
  width: max-content;
  animation: scrollMarquee 20s linear infinite;
}

.animate-scroll:hover {
  animation-play-state: paused;
}

/* Timeline Scroll Reveal Animations */
.timeline-item {
  opacity: 0;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.timeline-item-left {
  transform: translateX(-36px);
}

.timeline-item-right {
  transform: translateX(36px);
}

.timeline-item.in-view {
  opacity: 1;
  transform: translateX(0);
}

.timeline-line-fill {
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.timeline-line-fill.in-view {
  transform: scaleY(1);
}

/* Reference-inspired homepage hero */
.hero-reference {
  position: relative;
  display: flex;
  height: calc(100svh - 186px);
  min-height: 580px;
  align-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 78% 42%, rgba(237, 27, 69, 0.09), transparent 24rem),
    #f7f8fb;
  padding: 8.5rem 1.5rem 5.5rem;
}

#hero-statistics {
  display: flex;
  height: 186px;
  align-items: center;
}

#hero-statistics > div {
  width: 100%;
}

.hero-reference::before {
  position: absolute;
  top: 8rem;
  right: -8rem;
  width: 25rem;
  height: 25rem;
  border: 1px solid rgba(237, 27, 69, 0.12);
  border-radius: 999px;
  content: "";
}

.hero-reference-shell {
  position: relative;
  z-index: 1;
  display: grid;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  align-items: center;
  gap: clamp(3rem, 6vw, 6.5rem);
}

.hero-reference-copy {
  max-width: 680px;
}

.hero-reference-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 1.8rem;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  background: #fff0f3;
  color: #c5143b;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1;
  text-transform: uppercase;
}

.hero-reference-eyebrow span {
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 999px;
  background: #ed1b45;
}

.hero-reference-title {
  max-width: 690px;
  margin: 0;
  color: #0e1730;
  font-family: "Montserrat", sans-serif;
  font-size: clamp(2.35rem, 3.35vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 1.03;
}

.hero-reference-title span {
  color: #ed1b45;
}

.hero-reference-description {
  max-width: 660px;
  margin: 1.8rem 0 0;
  color: #647085;
  font-size: clamp(1rem, 1.4vw, 1.12rem);
  line-height: 1.7;
}

.hero-reference-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem;
  margin-top: 2rem;
}

.hero-reference-cta {
  display: inline-flex;
  min-height: 3.45rem;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border: 1px solid transparent;
  border-radius: 0.8rem;
  padding: 0.85rem 1.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.hero-reference-cta:hover {
  transform: translateY(-2px);
}

.hero-reference-cta:focus-visible {
  outline: 3px solid rgba(237, 27, 69, 0.32);
  outline-offset: 3px;
}

.hero-reference-cta-primary {
  background: #ed1b45;
  color: #fff;
  box-shadow: 0 12px 25px rgba(237, 27, 69, 0.2);
}

.hero-reference-cta-primary:hover {
  background: #c9143a;
  box-shadow: 0 16px 30px rgba(237, 27, 69, 0.27);
}

.hero-reference-cta-secondary {
  border-color: #d9dee5;
  background: rgba(255, 255, 255, 0.72);
  color: #0e1730;
}

.hero-reference-cta-secondary:hover {
  border-color: #ed1b45;
  background: #fff;
}

.hero-reference-cta-profile {
  border-color: #0e1730;
  background: #0e1730;
  color: #fff;
  cursor: pointer;
}

.hero-reference-cta-profile:hover {
  background: #1d2a49;
}

.hero-reference-cta-profile svg {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
}

.hero-reference-media {
  position: relative;
  aspect-ratio: 1.28 / 1;
  overflow: hidden;
  border: 5px solid #fff;
  border-radius: 1.8rem;
  background: #e7eaf0;
  box-shadow: 0 30px 55px rgba(15, 23, 42, 0.2);
}

.hero-reference-media.hero-reference-motion {
  aspect-ratio: 16 / 9;
}

.hero-reference-media::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(8, 16, 35, 0.22));
  content: "";
  pointer-events: none;
}

.hero-reference-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 700ms cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-reference-media:hover img {
  transform: scale(1.035);
}

/* Homepage services orbit */
.hero-services-visual {
  position: relative;
  width: min(100%, 480px);
  aspect-ratio: 1;
  justify-self: end;
  filter: drop-shadow(0 28px 35px rgba(15, 31, 92, 0.14));
  animation: services-visual-in 1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero-services-visual::before {
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(237, 27, 69, 0.11), rgba(15, 31, 92, 0.035) 48%, transparent 70%);
  content: "";
  filter: blur(10px);
}

.services-orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  border: 1px solid rgba(15, 31, 92, 0.17);
  border-radius: 50%;
}

.services-orbit::before {
  position: absolute;
  inset: -2px;
  border: 2px solid transparent;
  border-top-color: rgba(237, 27, 69, 0.78);
  border-right-color: rgba(237, 27, 69, 0.16);
  border-radius: inherit;
  content: "";
}

.services-orbit-outer {
  width: 88%;
  height: 88%;
  animation: services-orbit-clockwise 34s linear infinite;
}

.services-orbit-middle {
  width: 64%;
  height: 64%;
  animation: services-orbit-counterclockwise 26s linear infinite;
}

.services-orbit-inner {
  width: 39%;
  height: 39%;
  border-color: rgba(237, 27, 69, 0.28);
  border-style: dashed;
  animation: services-orbit-clockwise 20s linear infinite;
}

.service-orbit-anchor {
  position: absolute;
  z-index: 3;
}

.service-orbit-anchor-top,
.service-orbit-anchor-bottom {
  left: 50%;
}

.service-orbit-anchor-top { top: 0; }
.service-orbit-anchor-bottom { bottom: 0; }

.service-orbit-anchor-left,
.service-orbit-anchor-right {
  top: 50%;
}

.service-orbit-anchor-left { left: 0; }
.service-orbit-anchor-right { right: 0; }

.service-orbit-card {
  display: flex;
  min-width: 176px;
  align-items: center;
  gap: 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.94);
  padding: 0.7rem 0.9rem;
  color: #647085;
  font-size: 0.69rem;
  font-weight: 600;
  line-height: 1.25;
  box-shadow: 0 14px 32px rgba(15, 31, 92, 0.15);
  backdrop-filter: blur(12px);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.service-orbit-card strong {
  display: block;
  color: #0f1f5c;
  font-size: 0.78rem;
  font-weight: 800;
}

.service-orbit-card:hover {
  border-color: rgba(237, 27, 69, 0.45);
  box-shadow: 0 18px 38px rgba(237, 27, 69, 0.2);
  transform: scale(1.04);
}

.service-orbit-icon {
  display: grid;
  width: 2.4rem;
  height: 2.4rem;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 0.8rem;
  background: linear-gradient(145deg, #ed1b45, #c8102e);
  color: #fff;
  box-shadow: 0 8px 18px rgba(237, 27, 69, 0.24);
}

.service-orbit-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.services-orbit-outer .service-orbit-card {
  animation: services-card-counterclockwise 34s linear infinite;
}

.services-orbit-middle .service-orbit-card {
  animation: services-card-clockwise 26s linear infinite;
}

.service-orbit-anchor-top .service-orbit-card,
.service-orbit-anchor-bottom .service-orbit-card {
  translate: -50% -50%;
}

.service-orbit-anchor-left .service-orbit-card {
  translate: -50% -50%;
}

.service-orbit-anchor-right .service-orbit-card {
  translate: 50% -50%;
}

.services-orbit-center {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 5;
  display: flex;
  width: 148px;
  height: 148px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  overflow: hidden;
  border: 5px solid #fff;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.96);
  color: #0f1f5c;
  text-align: center;
  box-shadow: 0 18px 42px rgba(15, 31, 92, 0.2);
  transform: translate(-50%, -50%);
}

.services-orbit-center img {
  position: relative;
  z-index: 2;
  width: 78px;
  height: auto;
  margin-bottom: 0.45rem;
}

.services-orbit-center strong,
.services-orbit-center > span:last-child {
  position: relative;
  z-index: 2;
}

.services-orbit-center strong {
  font-size: 0.77rem;
  font-weight: 800;
}

.services-orbit-center > span:last-child {
  width: 100%;
  max-width: 104px;
  margin-top: 0.2rem;
  padding: 0 0.2rem;
  color: #ed1b45;
  font-size: 0.54rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  line-height: 1.18;
  text-align: center;
  text-transform: uppercase;
}

.services-orbit-pulse {
  position: absolute;
  inset: 0.6rem;
  border: 1px solid rgba(237, 27, 69, 0.25);
  border-radius: 50%;
  animation: services-center-pulse 2.8s ease-out infinite;
}

@keyframes services-orbit-clockwise {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes services-orbit-counterclockwise {
  from { transform: translate(-50%, -50%) rotate(360deg); }
  to { transform: translate(-50%, -50%) rotate(0deg); }
}

@keyframes services-card-clockwise {
  from { rotate: 0deg; }
  to { rotate: 360deg; }
}

@keyframes services-card-counterclockwise {
  from { rotate: 0deg; }
  to { rotate: -360deg; }
}

@keyframes services-center-pulse {
  0% { opacity: 0.8; transform: scale(0.82); }
  75%, 100% { opacity: 0; transform: scale(1.15); }
}

@keyframes services-visual-in {
  from { opacity: 0; transform: scale(0.84); }
  to { opacity: 1; transform: scale(1); }
}

@media (min-width: 1025px) and (max-height: 850px) {
  .hero-reference-eyebrow {
    display: none;
  }
}

@media (max-width: 1024px) {
  .hero-reference {
    height: auto;
    min-height: auto;
    padding-top: 7.5rem;
  }

  #hero-statistics {
    height: auto;
  }

  .hero-reference-shell {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .hero-reference-title {
    font-size: clamp(2.2rem, 5vw, 3.3rem);
  }

  .hero-reference-copy {
    max-width: 720px;
  }

  .hero-reference-media {
    width: 100%;
    max-width: 720px;
    aspect-ratio: 16 / 10;
  }

  .hero-services-visual {
    width: min(100%, 520px);
    justify-self: center;
  }
}

@media (max-width: 820px) {
  .hero-reference {
    min-height: auto;
    padding: 7.5rem 1.25rem 4rem;
  }

  .hero-reference-media {
    max-width: 680px;
  }

  .hero-services-visual {
    width: min(100%, 440px);
  }
}

@media (max-width: 560px) {
  .hero-reference {
    padding: 6.75rem 1rem 3rem;
  }

  .hero-reference-eyebrow {
    margin-bottom: 1.25rem;
    font-size: 0.62rem;
    letter-spacing: 0.12em;
  }

  .hero-reference-title {
    max-width: 100%;
    font-size: clamp(1.9rem, 8.5vw, 2.2rem);
    letter-spacing: -0.04em;
    line-height: 1.08;
    text-wrap: balance;
  }

  .hero-reference-description {
    margin-top: 1.25rem;
    font-size: 0.96rem;
  }

  .hero-reference-actions {
    align-items: stretch;
    flex-direction: column;
    margin-top: 1.6rem;
  }

  .hero-reference-cta {
    width: 100%;
  }

  .hero-reference-media {
    border-width: 4px;
    border-radius: 1.3rem;
  }

  .hero-services-visual {
    width: min(100%, 350px);
  }

  .service-orbit-card {
    min-width: 136px;
    gap: 0.45rem;
    padding: 0.55rem 0.65rem;
    font-size: 0.58rem;
  }

  .service-orbit-card strong {
    font-size: 0.66rem;
  }

  .service-orbit-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 0.65rem;
  }

  .service-orbit-icon svg {
    width: 1rem;
    height: 1rem;
  }

  .services-orbit-center {
    width: 112px;
    height: 112px;
    border-width: 4px;
  }

  .services-orbit-center img {
    width: 58px;
    margin-bottom: 0.25rem;
  }

  .services-orbit-center strong {
    font-size: 0.64rem;
  }

  .services-orbit-center > span:last-child {
    max-width: 82px;
    font-size: 0.43rem;
    letter-spacing: 0.055em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-reference-cta,
  .hero-reference-media img {
    transition: none;
  }

  .hero-services-visual,
  .services-orbit,
  .service-orbit-card,
  .services-orbit-pulse {
    animation: none !important;
  }
}
