:root {
  --ma-hero-art-width: 460px;
  --ma-premium-ease: cubic-bezier(0.22, 0.7, 0.18, 1);
}

.hero-meta {
  margin-top: 0.62rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.54rem;
  border-radius: 999px;
  border: 1px solid rgba(145, 216, 252, 0.3);
  background: rgba(12, 35, 57, 0.56);
  color: #c9e6fb;
  font-size: 0.73rem;
  letter-spacing: 0.02em;
  font-weight: 600;
}

.hero.hero-with-art,
.hero:not(.hero-with-art),
.portal-hero.portal-hero-with-art {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.hero.hero-with-art,
.portal-hero.portal-hero-with-art {
  grid-template-columns: minmax(0, 1.12fr) minmax(300px, var(--ma-hero-art-width)) !important;
  gap: 1rem;
  align-items: center;
}

.hero.hero-with-art::before,
.hero:not(.hero-with-art)::before,
.portal-hero.portal-hero-with-art::before {
  content: "";
  position: absolute;
  width: 460px;
  height: 460px;
  right: -132px;
  top: -208px;
  background: radial-gradient(circle, rgba(124, 242, 222, 0.2), rgba(124, 242, 222, 0));
  filter: blur(2px);
  pointer-events: none;
}

.hero.hero-with-art::after,
.hero:not(.hero-with-art)::after,
.portal-hero.portal-hero-with-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(97deg, rgba(4, 15, 28, 0.04), rgba(4, 15, 28, 0.2) 58%, rgba(4, 15, 28, 0.3));
  pointer-events: none;
}

.hero.hero-with-art .hero-copy,
.hero.hero-with-art .hero-art,
.hero:not(.hero-with-art) > *,
.portal-hero.portal-hero-with-art .portal-copy,
.portal-hero.portal-hero-with-art .portal-art {
  position: relative;
  z-index: 1;
}

.hero.hero-with-art .hero-art,
.portal-hero.portal-hero-with-art .portal-art {
  margin: 0;
  width: min(100%, var(--ma-hero-art-width)) !important;
  max-width: var(--ma-hero-art-width);
  justify-self: end;
  padding: 0.46rem;
  border-radius: 20px;
  border: 1px solid rgba(141, 215, 255, 0.28);
  background: linear-gradient(138deg, rgba(12, 39, 63, 0.85), rgba(14, 53, 78, 0.75));
  box-shadow: inset 0 1px 0 rgba(186, 234, 255, 0.11), 0 18px 34px rgba(2, 10, 18, 0.34);
}

.hero.hero-with-art .hero-art img,
.portal-hero.portal-hero-with-art .portal-art img {
  width: 100%;
  height: auto;
  aspect-ratio: 960 / 620;
  object-fit: cover;
  border-radius: 15px;
  border: 1px solid rgba(146, 214, 250, 0.3);
  background: linear-gradient(140deg, rgba(14, 48, 74, 0.72), rgba(9, 32, 52, 0.8));
  box-shadow: inset 0 1px 0 rgba(191, 237, 255, 0.1), 0 18px 32px rgba(2, 10, 18, 0.38);
}

.hero,
.portal-hero,
.panel,
.card,
.block,
.board-card,
.control-card,
.hud-item,
.game-panel,
.scene-box,
.case-card,
.monitor-frame,
.abg-board,
.sepsis-board {
  transition:
    transform 260ms var(--ma-premium-ease),
    border-color 260ms var(--ma-premium-ease),
    box-shadow 260ms var(--ma-premium-ease),
    background-color 260ms var(--ma-premium-ease);
}

.powered-by a {
  transition: color 180ms ease, text-shadow 180ms ease;
}

@keyframes maHeroTextIn {
  from {
    opacity: 0;
    transform: translateY(11px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes maOrbDrift {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(-18px, 12px, 0);
  }
}

@keyframes maHeroFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

@media (min-width: 901px) and (prefers-reduced-motion: no-preference) {
  .hero.hero-with-art::before,
  .hero:not(.hero-with-art)::before,
  .portal-hero.portal-hero-with-art::before {
    animation: maOrbDrift 12.6s ease-in-out infinite;
  }

  .hero.hero-with-art .eyebrow,
  .hero:not(.hero-with-art) .eyebrow,
  .hero.hero-with-art h1,
  .hero:not(.hero-with-art) h1,
  .hero.hero-with-art .subtitle,
  .hero:not(.hero-with-art) .subtitle,
  .hero.hero-with-art .hero-meta,
  .hero:not(.hero-with-art) .hero-meta,
  .hero.hero-with-art .link-line,
  .hero:not(.hero-with-art) .link-line,
  .portal-hero.portal-hero-with-art .portal-eyebrow,
  .portal-hero.portal-hero-with-art h1,
  .portal-hero.portal-hero-with-art .portal-subtitle,
  .portal-hero.portal-hero-with-art .hero-meta,
  .portal-hero.portal-hero-with-art .portal-link-wrap {
    opacity: 0;
    animation: maHeroTextIn 520ms var(--ma-premium-ease) forwards;
  }

  .hero.hero-with-art h1,
  .hero:not(.hero-with-art) h1,
  .portal-hero.portal-hero-with-art h1 {
    animation-delay: 62ms;
  }

  .hero.hero-with-art .subtitle,
  .hero:not(.hero-with-art) .subtitle,
  .portal-hero.portal-hero-with-art .portal-subtitle {
    animation-delay: 128ms;
  }

  .hero.hero-with-art .hero-meta,
  .hero:not(.hero-with-art) .hero-meta,
  .portal-hero.portal-hero-with-art .hero-meta {
    animation-delay: 182ms;
  }

  .hero.hero-with-art .link-line,
  .hero:not(.hero-with-art) .link-line,
  .portal-hero.portal-hero-with-art .portal-link-wrap {
    animation-delay: 226ms;
  }

  .hero.hero-with-art .hero-art img,
  .portal-hero.portal-hero-with-art .portal-art img {
    animation: maHeroFloat 8.8s ease-in-out infinite;
  }

  .panel:hover,
  .card:hover,
  .block:hover,
  .board-card:hover,
  .control-card:hover,
  .scene-box:hover,
  .case-card:hover,
  .game-panel:hover,
  .monitor-frame:hover {
    transform: translateY(-2px);
    border-color: rgba(154, 229, 255, 0.42);
    box-shadow: 0 20px 34px rgba(2, 10, 18, 0.3);
  }

  .hud-item:hover {
    transform: translateY(-1px) scale(1.01);
    border-color: rgba(150, 229, 255, 0.45);
  }

  .hero-pill {
    transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease;
  }

  .hero-pill:hover {
    transform: translateY(-1px);
    border-color: rgba(154, 229, 255, 0.46);
    background: rgba(18, 44, 68, 0.8);
  }

  .powered-by a:hover {
    color: #d5ecfb;
    text-shadow: 0 0 12px rgba(147, 213, 247, 0.36);
  }
}

@media (max-width: 1120px) {
  .hero.hero-with-art,
  .portal-hero.portal-hero-with-art {
    grid-template-columns: 1fr !important;
  }

  .hero.hero-with-art .hero-art,
  .portal-hero.portal-hero-with-art .portal-art {
    width: min(100%, 500px) !important;
  }
}

@media (max-width: 900px) {
  .hero.hero-with-art,
  .portal-hero.portal-hero-with-art {
    padding: clamp(0.74rem, 2.8vw, 0.94rem) !important;
    border-radius: 18px;
  }

  .hero-meta {
    margin-top: 0.54rem;
    gap: 0.34rem;
  }

  .hero-pill {
    padding: 0.24rem 0.48rem;
    font-size: 0.68rem;
  }

  .panel,
  .card,
  .block,
  .board-card,
  .control-card,
  .hud-item,
  .game-panel,
  .scene-box,
  .case-card,
  .monitor-frame,
  .abg-board,
  .sepsis-board {
    border-radius: 15px;
    backdrop-filter: blur(10px) saturate(120%);
  }

  button,
  .btn,
  .secondary-btn,
  .mode-btn,
  .option-btn,
  .action-btn {
    border-radius: 12px;
  }

  .subtitle,
  .portal-subtitle {
    line-height: 1.45;
  }
}

@media (max-width: 820px) {
  .hero.hero-with-art .hero-art,
  .portal-hero.portal-hero-with-art .portal-art {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero.hero-with-art::before,
  .portal-hero.portal-hero-with-art::before {
    animation: none !important;
  }

  .hero.hero-with-art .hero-art img,
  .portal-hero.portal-hero-with-art .portal-art img {
    animation: none !important;
  }
}
