/**
 * Proxy Grove — Enterprise Hero
 * Grove design tokens · premium SaaS composition
 */

.pg-hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: 4.5rem 0 3.5rem;
  background:
    radial-gradient(ellipse 90% 55% at 50% -25%, rgb(19 0 154 / 0.08), transparent 55%),
    radial-gradient(ellipse 45% 40% at 100% 8%, rgb(0 0 174 / 0.06), transparent 50%),
    radial-gradient(ellipse 40% 35% at 0% 85%, rgb(19 127 21 / 0.05), transparent 50%),
    var(--color-surface-body);
}

/* Soft grid texture */
.pg-hero__grid-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgb(19 0 154 / 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgb(19 0 154 / 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
}

.pg-hero__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(72px);
  pointer-events: none;
  z-index: 0;
  will-change: transform;
}

.pg-hero__glow--1 {
  width: 28rem;
  height: 28rem;
  top: -8rem;
  right: -5rem;
  background: rgb(19 0 154 / 0.14);
  animation: pg-glow-drift 12s ease-in-out infinite;
}

.pg-hero__glow--2 {
  width: 22rem;
  height: 22rem;
  bottom: 5%;
  left: -6rem;
  background: rgb(19 127 21 / 0.12);
  animation: pg-glow-drift 14s ease-in-out infinite reverse;
}

.pg-hero__glow--3 {
  width: 16rem;
  height: 16rem;
  top: 42%;
  left: 42%;
  background: rgb(0 0 174 / 0.08);
  animation: pg-glow-drift 10s ease-in-out infinite 2s;
}

.pg-hero__inner {
  position: relative;
  z-index: 1;
}

.pg-hero__grid {
  display: grid;
  gap: 2.75rem;
  align-items: center;
}

@media (min-width: 1024px) {
  .pg-hero {
    padding: 5.5rem 0 4.5rem;
  }

  .pg-hero__grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 3rem;
  }

  .pg-hero__content,
  .pg-hero__visual {
    min-width: 0;
  }
}

/* —— Left column —— */
.pg-hero__content {
  text-align: center;
}

@media (min-width: 1024px) {
  .pg-hero__content {
    text-align: left;
  }
}

.pg-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 1rem 0.375rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--color-text-heading);
  background: var(--color-surface-raised);
  border: 1px solid rgb(19 0 154 / 0.12);
  box-shadow: 0 4px 24px rgb(19 0 154 / 0.06);
  margin-bottom: 1.35rem;
}

.pg-hero__badge-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 9999px;
  background: rgb(19 0 154 / 0.08);
  color: var(--color-text-heading);
  flex-shrink: 0;
}

.pg-hero__badge-icon svg {
  width: 0.875rem;
  height: 0.875rem;
}

.pg-hero__badge-pulse {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--color-button-primary-bg);
  box-shadow: 0 0 0 0 rgb(19 127 21 / 0.45);
  animation: pg-pulse-ring 2.2s ease-out infinite;
}

.pg-hero__title {
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: clamp(2.125rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--color-text-heading);
  margin: 0;
  max-width: 18ch;
}

@media (min-width: 1024px) {
  .pg-hero__title {
    max-width: none;
  }
}

.pg-hero__desc {
  margin: 1.35rem auto 0;
  max-width: 36rem;
  font-size: clamp(1rem, 2.2vw, 1.125rem);
  line-height: 1.65;
  color: var(--color-text-body);
}

@media (min-width: 1024px) {
  .pg-hero__desc {
    margin-left: 0;
    margin-right: 0;
  }
}

.pg-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.875rem;
  justify-content: center;
  margin-top: 1.85rem;
}

@media (min-width: 1024px) {
  .pg-hero__actions {
    justify-content: flex-start;
  }
}

.pg-hero__btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  border-radius: var(--radius-btn);
  font-weight: 700;
  font-size: 0.9375rem;
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.pg-hero__btn--primary {
  color: var(--color-button-primary-text);
  background: var(--color-button-primary-bg);
  box-shadow: 0 0 24px rgb(19 127 21 / 0.28);
}

.pg-hero__btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgb(19 127 21 / 0.38);
}

.pg-hero__btn--secondary {
  font-weight: 600;
  color: var(--color-text-heading);
  background: rgb(255 255 255 / 0.92);
  border: 1px solid rgb(19 0 154 / 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.pg-hero__btn--secondary:hover {
  transform: translateY(-2px);
  border-color: rgb(19 0 154 / 0.28);
  box-shadow: 0 8px 32px rgb(19 0 154 / 0.1);
}

.pg-hero__btn:focus-visible {
  outline: 2px solid var(--color-text-heading);
  outline-offset: 3px;
}

.pg-hero__btn svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.pg-hero__ripple {
  position: absolute;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.35);
  transform: scale(0);
  animation: pg-ripple 0.55s ease-out forwards;
  pointer-events: none;
}

.pg-hero__btn--secondary .pg-hero__ripple {
  background: rgb(19 0 154 / 0.18);
}

.pg-hero__trust {
  list-style: none;
  margin: 1.65rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.35rem;
  justify-content: center;
}

@media (min-width: 1024px) {
  .pg-hero__trust {
    justify-content: flex-start;
  }
}

.pg-hero__trust li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-body);
}

.pg-hero__trust-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 9999px;
  background: rgb(19 127 21 / 0.12);
  color: var(--color-button-primary-bg);
  flex-shrink: 0;
}

.pg-hero__trust-check svg {
  width: 0.7rem;
  height: 0.7rem;
}

/* —— Right: dashboard visual —— */
.pg-hero__visual {
  position: relative;
  width: 100%;
  max-width: 32rem;
  margin: 0 auto;
  content-visibility: auto;
  contain-intrinsic-size: 420px;
}

@media (min-width: 1024px) {
  .pg-hero__visual {
    max-width: 100%;
    min-height: 28rem;
    margin: 0;
  }
}

.pg-dash {
  position: relative;
  width: 100%;
  min-height: 22rem;
}

@media (min-width: 1024px) {
  .pg-dash {
    min-height: 28rem;
  }
}

.pg-dash__card {
  border-radius: var(--radius-card);
  background: color-mix(in srgb, var(--color-surface-raised) 88%, transparent);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border: 1px solid color-mix(in srgb, var(--color-text-heading) 10%, transparent);
  box-shadow: var(--shadow-glass);
  padding: 0.875rem 1rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.pg-dash__card:hover {
  transform: translateY(-3px);
  box-shadow:
    0 8px 16px rgb(19 0 154 / 0.06),
    0 24px 56px rgb(19 0 154 / 0.14);
}

.pg-dash__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.pg-dash__label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-heading);
}

.pg-dash__dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--color-button-primary-bg);
  flex-shrink: 0;
}

.pg-dash__dot--live {
  animation: pg-pulse-ring 2s ease-out infinite;
}

.pg-dash__status {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.5625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-button-primary-bg);
  background: rgb(19 127 21 / 0.1);
}

.pg-dash__metric {
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--color-text-heading);
  letter-spacing: -0.02em;
}

.pg-dash__metric--green {
  color: var(--color-button-primary-bg);
}

.pg-dash__sub {
  margin-top: 0.15rem;
  font-size: 0.625rem;
  color: var(--color-text-body);
  opacity: 0.72;
}

/* Mobile / tablet: stacked grid */
.pg-dash__stage {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.pg-dash__card--main {
  grid-column: 1 / -1;
}

.pg-dash__card--map {
  grid-column: 1 / -1;
}

/* Accent floaters: desktop-only to keep mobile lean */
@media (max-width: 1023px) {
  .pg-dash__card--health,
  .pg-dash__card--secure,
  .pg-dash__card--nodes {
    display: none;
  }
}

@media (min-width: 640px) and (max-width: 1023px) {
  .pg-dash__stage {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.875rem;
  }

  .pg-dash__card--main {
    grid-column: 1 / 3;
  }

  .pg-dash__card--map {
    grid-column: 3;
    grid-row: 1 / 3;
  }
}

/* Desktop: floating absolute composition */
@media (min-width: 1024px) {
  .pg-dash__stage {
    display: block;
    position: relative;
    min-height: 28rem;
    isolation: isolate;
  }

  .pg-dash__card {
    position: absolute;
    max-width: calc(100% - 1rem);
    animation: pg-hero-float 6.5s ease-in-out infinite;
  }

  .pg-dash__card--main {
    inset: 14% 10% 22% 10%;
    z-index: 2;
    max-width: none;
    padding: 1.1rem 1.2rem;
    animation-delay: 0s;
  }

  .pg-dash__card--connections {
    top: 0;
    left: 2%;
    width: min(34%, 10.5rem);
    z-index: 5;
    animation-delay: -1.2s;
  }

  .pg-dash__card--map {
    top: 2%;
    right: 2%;
    width: min(42%, 13rem);
    z-index: 4;
    animation-delay: -2s;
  }

  .pg-dash__card--latency {
    top: 38%;
    left: 0;
    width: min(30%, 9.5rem);
    z-index: 4;
    animation-delay: -3.2s;
  }

  .pg-dash__card--rotation {
    top: 42%;
    right: 0;
    width: min(32%, 10rem);
    z-index: 5;
    animation-delay: -1.8s;
  }

  .pg-dash__card--success {
    bottom: 8%;
    left: 8%;
    width: min(30%, 9.5rem);
    z-index: 4;
    animation-delay: -4s;
  }

  .pg-dash__card--requests {
    bottom: 4%;
    right: 10%;
    width: min(36%, 11rem);
    z-index: 5;
    animation-delay: -2.6s;
  }

  .pg-dash__card--health {
    bottom: 28%;
    left: 28%;
    width: min(28%, 9rem);
    z-index: 3;
    animation-delay: -3.5s;
  }

  .pg-dash__card--secure {
    top: 22%;
    right: 28%;
    width: min(26%, 8.5rem);
    z-index: 6;
    animation-delay: -0.8s;
  }

  .pg-dash__card--nodes {
    bottom: 18%;
    right: 36%;
    width: min(26%, 8.25rem);
    z-index: 3;
    animation-delay: -4.5s;
  }
}

/* Main dashboard body */
.pg-dash__main-body {
  display: grid;
  gap: 0.85rem;
}

.pg-dash__stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.pg-dash__stat {
  padding: 0.55rem 0.5rem;
  border-radius: 0.625rem;
  background: linear-gradient(
    160deg,
    rgb(19 0 154 / 0.05),
    rgb(19 127 21 / 0.04)
  );
  border: 1px solid rgb(19 0 154 / 0.06);
  text-align: center;
}

.pg-dash__stat-value {
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text-heading);
  letter-spacing: -0.02em;
}

.pg-dash__stat-label {
  margin-top: 0.1rem;
  font-size: 0.5rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-body);
  opacity: 0.7;
}

.pg-dash__bars {
  display: flex;
  align-items: flex-end;
  gap: 0.3rem;
  height: 3.25rem;
  padding-top: 0.2rem;
}

.pg-dash__bars span {
  flex: 1;
  border-radius: 0.2rem 0.2rem 0 0;
  background: linear-gradient(
    180deg,
    var(--color-text-heading),
    color-mix(in srgb, var(--color-text-heading) 45%, transparent)
  );
  animation: pg-bar-pulse 2.4s ease-in-out infinite alternate;
}

.pg-dash__bars span:nth-child(1) { height: 42%; animation-delay: 0s; }
.pg-dash__bars span:nth-child(2) { height: 68%; animation-delay: 0.15s; }
.pg-dash__bars span:nth-child(3) { height: 52%; animation-delay: 0.3s; }
.pg-dash__bars span:nth-child(4) { height: 88%; animation-delay: 0.45s; }
.pg-dash__bars span:nth-child(5) { height: 60%; animation-delay: 0.6s; }
.pg-dash__bars span:nth-child(6) { height: 78%; animation-delay: 0.75s; }
.pg-dash__bars span:nth-child(7) { height: 48%; animation-delay: 0.9s; }
.pg-dash__bars span:nth-child(8) { height: 95%; animation-delay: 1.05s; }

/* Coverage map */
.pg-dash__map {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 0.625rem;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 70% at 50% 50%, rgb(19 0 154 / 0.06), transparent 70%),
    linear-gradient(180deg, rgb(249 250 251), rgb(240 242 248));
  border: 1px solid rgb(19 0 154 / 0.06);
}

.pg-dash__map svg {
  width: 100%;
  height: 100%;
}

.pg-dash__map-node {
  fill: var(--color-text-heading);
  opacity: 0.85;
}

.pg-dash__map-node--active {
  fill: var(--color-button-primary-bg);
  animation: pg-map-blink 2.8s ease-in-out infinite;
}

.pg-dash__map-ring {
  fill: none;
  stroke: var(--color-button-primary-bg);
  stroke-width: 1;
  opacity: 0.35;
  animation: pg-map-ring 3s ease-out infinite;
}

/* Latency sparkline */
.pg-dash__spark {
  width: 100%;
  height: 2rem;
  margin-top: 0.35rem;
  color: var(--color-text-heading);
}

.pg-dash__spark polyline:first-child {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pg-dash__spark polyline:last-child {
  stroke: none;
  fill: color-mix(in srgb, var(--color-text-heading) 12%, transparent);
}

/* Rotation ring */
.pg-dash__ring-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.25rem;
}

.pg-dash__ring {
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  transform: rotate(-90deg);
}

.pg-dash__ring-track {
  fill: none;
  stroke: rgb(19 0 154 / 0.1);
  stroke-width: 3.5;
}

.pg-dash__ring-fill {
  fill: none;
  stroke: var(--color-button-primary-bg);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-dasharray: 88;
  stroke-dashoffset: 14;
  animation: pg-ring-spin 4s ease-in-out infinite;
}

.pg-dash__secure-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pg-dash__secure-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.5rem;
  background: rgb(19 127 21 / 0.1);
  color: var(--color-button-primary-bg);
}

.pg-dash__secure-icon svg {
  width: 0.95rem;
  height: 0.95rem;
}

.pg-dash__health-bar {
  margin-top: 0.45rem;
  height: 0.35rem;
  border-radius: 9999px;
  background: rgb(19 0 154 / 0.08);
  overflow: hidden;
}

.pg-dash__health-fill {
  height: 100%;
  width: 98%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--color-button-primary-bg), #1a9a1c);
  animation: pg-health-glow 2.5s ease-in-out infinite;
}

.pg-dash__live-feed {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 0.35rem;
}

.pg-dash__live-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  font-size: 0.5625rem;
  font-family: ui-monospace, "Cascadia Code", monospace;
  color: var(--color-text-body);
  opacity: 0.8;
}

.pg-dash__live-code {
  color: var(--color-button-primary-bg);
  font-weight: 700;
}

/* Staggered entrance */
.pg-hero__content > * {
  animation: gw-fade-in-up 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.pg-hero__badge { animation-delay: 0.05s; }
.pg-hero__title { animation-delay: 0.1s; }
.pg-hero__desc { animation-delay: 0.18s; }
.pg-hero__actions { animation-delay: 0.26s; }
.pg-hero__trust { animation-delay: 0.34s; }

.pg-hero__visual {
  animation: gw-fade-in-up 0.85s cubic-bezier(0.16, 1, 0.3, 1) 0.22s both;
}

/* Keyframes */
@keyframes pg-hero-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes pg-bar-pulse {
  from { opacity: 0.65; }
  to { opacity: 1; }
}

@keyframes pg-pulse-ring {
  0% {
    box-shadow: 0 0 0 0 rgb(19 127 21 / 0.45);
  }
  70% {
    box-shadow: 0 0 0 6px rgb(19 127 21 / 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgb(19 127 21 / 0);
  }
}

@keyframes pg-glow-drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(12px, -16px) scale(1.06); }
}

@keyframes pg-ripple {
  to {
    transform: scale(2.4);
    opacity: 0;
  }
}

@keyframes pg-map-blink {
  0%, 100% { opacity: 0.9; }
  50% { opacity: 0.45; }
}

@keyframes pg-map-ring {
  0% {
    r: 3;
    opacity: 0.45;
  }
  100% {
    r: 10;
    opacity: 0;
  }
}

@keyframes pg-ring-spin {
  0%, 100% { stroke-dashoffset: 14; }
  50% { stroke-dashoffset: 22; }
}

@keyframes pg-health-glow {
  0%, 100% { opacity: 1; filter: brightness(1); }
  50% { opacity: 0.85; filter: brightness(1.15); }
}

@media (prefers-reduced-motion: reduce) {
  .pg-hero__glow,
  .pg-dash__card,
  .pg-dash__bars span,
  .pg-dash__dot--live,
  .pg-hero__badge-pulse,
  .pg-dash__map-node--active,
  .pg-dash__map-ring,
  .pg-dash__ring-fill,
  .pg-dash__health-fill,
  .pg-hero__content > *,
  .pg-hero__visual {
    animation: none !important;
  }

  .pg-dash__card:hover {
    transform: none;
  }
}

/* Small phones: tighten visual */
@media (max-width: 479px) {
  .pg-hero {
    padding: 3.25rem 0 2.75rem;
  }

  .pg-hero__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .pg-hero__btn {
    width: 100%;
  }

  .pg-hero__title {
    max-width: none;
  }
}
