/* Home redesign: hero and flagship cards (the header is in header.css). Scoped to .rsm-* so
   shared styles.css rules for inner pages stay untouched. */
[data-theme="dark"] .rsm-hero-photo {
  filter: brightness(0.55) saturate(0.9);
}

/* ---------- Hero ---------- */
.rsm-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(60% 80% at 78% 40%, var(--rh-glow), transparent 70%),
    linear-gradient(180deg, var(--rh-hero-bg-1), var(--rh-hero-bg-2));
}
.rsm-hero::after {
  /* soft wave behind the cards */
  content: "";
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: -1px;
  height: 11rem;
  background: var(--bg-page);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  opacity: 0.85;
}
.rsm-hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: 2rem;
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: clamp(2rem, 4vw, 3.5rem) clamp(1rem, 2.5vw, 2.5rem) 1rem;
}
.rsm-hero .hero-copy > p.rsm-eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--rh-blue);
}
.rsm-hero h1 {
  margin: 0;
  font-size: clamp(2.2rem, 3.9vw, 3.9rem);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.03em;
  color: var(--rh-navy);
}
.rsm-hero h1 .rsm-gradient-text {
  display: block;
  background: linear-gradient(90deg, var(--rh-blue-strong), var(--rh-teal));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.rsm-hero .hero-copy > p.rsm-lede {
  max-width: 38rem;
  margin: 1.25rem 0 1.75rem;
  font-size: clamp(1rem, 1.2vw, 1.1rem);
  line-height: 1.55;
  color: var(--rh-ink);
}
.rsm-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}
.rsm-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.75rem;
  font-weight: 700;
  font-size: 0.75rem;
  border: 1.5px solid var(--rh-blue-strong);
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease;
}
.rsm-btn svg {
  width: 1.2rem;
  height: 1.2rem;
}
.rsm-btn-primary {
  background: var(--rh-blue-strong);
  color: #fff;
}
.rsm-btn-primary:hover {
  background: var(--rh-navy);
  border-color: var(--rh-navy);
}
[data-theme="dark"] .rsm-btn-primary:hover {
  background: var(--rh-blue);
  border-color: var(--rh-blue);
  color: #0a1626;
}
.rsm-btn-outline {
  background: var(--bg-surface);
  color: var(--rh-blue-strong);
}
[data-theme="dark"] .rsm-btn-outline {
  color: var(--rh-blue);
}
.rsm-btn-outline:hover {
  background: var(--surface-hover);
}
.rsm-trust {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0;
  margin: 1.1rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--rh-ink);
}
.rsm-trust li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.rsm-trust li + li::before {
  content: "";
  width: 4px;
  height: 4px;
  margin: 0 0.75rem;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.45;
}
.rsm-trust svg {
  width: 1.1rem;
  height: 1.1rem;
  color: var(--rh-badge-green);
}
.rsm-trust a {
  color: var(--rh-blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.rsm-hero .hero-copy > p.rsm-patient-line {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0.9rem 0 0;
  font-size: 0.9rem;
  color: var(--rh-ink);
}
.rsm-patient-line svg {
  flex: 0 0 auto;
  width: 1.3rem;
  height: 1.3rem;
  color: var(--rh-blue);
}
.rsm-patient-line a {
  font-weight: 700;
  color: var(--rh-blue);
}

/* Visual */
.rsm-hero-visual {
  position: relative;
  min-height: 26rem;
}
/* Lab photo, mirrored so the microscope sits on the right like the mockup */
.rsm-hero-top {
  position: relative;
}
.rsm-hero-photo {
  position: absolute;
  inset: 0 0 0 30%;
  /* whole-pixel edge: a fractional left edge leaves a 1px line under the mask */
  left: round(30%, 1px);
  background: left center / cover no-repeat;
  background-image: url("/assets/optimized/hero-background1.jpg");
  background-image: image-set(
    url("/assets/optimized/hero-background1.avif") type("image/avif"),
    url("/assets/optimized/hero-background1.webp") type("image/webp"),
    url("/assets/optimized/hero-background1.jpg") type("image/jpeg")
  );
  transform: scaleX(-1);
  /* Fade into the hero on the visual left and bottom. The layer is
     mirrored, so "to left" here reads left-to-right on screen. */
  -webkit-mask-image:
    linear-gradient(to left, transparent 0%, transparent 2%, #000 45%),
    linear-gradient(to top, transparent 0%, #000 30%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to left, transparent 0%, transparent 2%, #000 45%),
    linear-gradient(to top, transparent 0%, #000 30%);
  mask-composite: intersect;
}
.rsm-pillar-card {
  position: absolute;
  right: 0;
  bottom: 0;
  width: min(27rem, 100%);
}
/* Logo sits on the panel's top-right edge, clear of the photo */
.rsm-logo-badge {
  position: absolute;
  top: -3.9rem;
  right: 1.25rem;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 4.75rem;
}
.rsm-logo-badge img {
  width: 100%;
  height: auto;
}
.rsm-pillars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.25rem;
  padding: 0.6rem;
  background: var(--bg-surface);
  border: 1px solid var(--rh-line);
  border-radius: 1rem;
  list-style: none;
  margin: 0;
}
.rsm-pillar-link {
  display: flex;
  height: 100%;
  padding: 0.6rem 0.35rem;
  border-radius: 0.9rem;
  transition: background-color 0.15s ease;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--rh-navy);
}
.rsm-pillar-link:hover,
.rsm-pillar-link:focus-visible {
  background: var(--surface-hover);
  color: var(--rh-blue);
}
.rsm-pillar-icon {
  display: grid;
  place-items: center;
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 50%;
}
.rsm-pillar-icon svg {
  width: 1.7rem;
  height: 1.7rem;
}
.rsm-pillar-icon.is-blue {
  background: var(--rh-tint-blue);
  color: var(--rh-blue-strong);
}
.rsm-pillar-icon.is-teal {
  background: var(--rh-tint-teal);
  color: var(--rh-teal);
}
.rsm-pillar-icon.is-indigo {
  background: var(--rh-tint-indigo);
  color: #4b63d8;
}
[data-theme="dark"] .rsm-pillar-icon.is-blue {
  color: var(--rh-blue);
}
[data-theme="dark"] .rsm-pillar-icon.is-indigo {
  color: #9aa8f5;
}

/* Flagship cards */
.rsm-flagships {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: 1rem clamp(1rem, 2.5vw, 2.5rem) 2.5rem;
  list-style: none;
}
.rsm-flagship {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.1rem 1.25rem 1.2rem;
  background: var(--bg-surface);
  border: 1px solid var(--rh-line);
  border-radius: 1rem;
  transition: border-color 0.15s ease;
}
.rsm-flagship:hover {
  border-color: var(--rh-blue);
}
.rsm-flagship-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
/* Plain logo, left-aligned at its natural shape */
.rsm-flagship-logo picture {
  display: block;
}
.rsm-flagship-logo img {
  display: block;
  width: auto;
  height: 2.6rem;
  max-width: 7rem;
  object-fit: contain;
  object-position: left center;
}
[data-theme="dark"] .rsm-flagship-logo {
  /* the product logos are drawn for light backgrounds */
  padding: 0.25rem 0.4rem;
  border-radius: 0.4rem;
  background: #eef3f8;
}
.rsm-flagship h2 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.25;
  color: var(--rh-navy);
}
.rsm-flagship h2 a::before {
  /* whole card is clickable */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}
.rsm-badge {
  flex: 0 0 auto;
  padding: 0.2rem 0.5rem;
  border: 1px solid currentColor;
  border-radius: 0.3rem;
  font-size: 0.64rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.rsm-badge.is-blue {
  color: #1269b8;
  background: #eaf3fc;
}
.rsm-badge.is-green {
  color: #1d7f3a;
  background: #e9f6ed;
}
.rsm-badge.is-purple {
  color: #5b3fc4;
  background: #f0ecfc;
}
[data-theme="dark"] .rsm-badge.is-blue {
  color: #7cc0f7;
  background: rgba(124, 192, 247, 0.1);
}
[data-theme="dark"] .rsm-badge.is-green {
  color: #7fd59a;
  background: rgba(127, 213, 154, 0.1);
}
[data-theme="dark"] .rsm-badge.is-purple {
  color: #b9a7f5;
  background: rgba(185, 167, 245, 0.12);
}
.rsm-flagship-desc {
  margin: 0.3rem 0 0.6rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.rsm-flagship-footer {
  margin: 0.3rem 0 0.6rem;
  font-size: 0.85rem;
  color: var(--text-heading);
}
.rsm-flagship-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-top: auto;
}
/* Inclusions as one line of text separated by middle dots */
.rsm-features {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--rh-ink);
}
/* Items never split; the dot rides on the end of the previous item, so a
   wrapped line never starts with a separator. */
.rsm-features li {
  display: inline;
  white-space: nowrap;
}
.rsm-features li:not(:last-child)::after {
  content: "\00b7";
  margin: 0 0.15rem 0 0.45rem;
  font-weight: 700;
  color: var(--text-muted);
}
.rsm-arrow {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 1px solid var(--rh-line-strong);
  background: var(--bg-surface);
  color: var(--rh-blue);
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}
.rsm-arrow svg {
  width: 0.95rem;
  height: 0.95rem;
}
.rsm-flagship:hover .rsm-arrow {
  background: var(--rh-blue);
  border-color: var(--rh-blue);
  color: #fff;
}

@keyframes rsm-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .rsm-btn,
  .rsm-flagship,
  .rsm-pillar-link {
    transition: none;
  }
}

/* Tablet landscape / small laptop (~1024) */
@media (min-width: 961px) and (max-width: 1199px) {
  .rsm-hero-inner {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 1.5rem;
    padding-top: 2.25rem;
  }
  .rsm-hero h1 {
    font-size: 2.6rem;
  }
  .rsm-hero .hero-copy > p.rsm-lede {
    margin: 1rem 0 1.4rem;
    font-size: 0.95rem;
  }
  .rsm-hero-actions {
    gap: 0.6rem;
  }
  .rsm-btn {
    padding: 0.65rem 0.95rem;
    font-size: 0.8rem;
  }
  .rsm-hero-photo {
    left: 40%;
    left: round(40%, 1px);
  }
  .rsm-hero-visual {
    min-height: 23rem;
  }
  .rsm-pillars {
    padding: 0.4rem;
  }
  .rsm-pillar-link {
    font-size: 0.72rem;
  }
  .rsm-pillar-icon {
    width: 2.8rem;
    height: 2.8rem;
  }
  .rsm-flagships {
    gap: 0.9rem;
  }
  .rsm-flagship {
    padding: 1rem;
  }
  .rsm-flagship h2 {
    font-size: 0.98rem;
  }
}
/* Tablet portrait: two cards, the third spans the row */
@media (min-width: 641px) and (max-width: 960px) {
  .rsm-flagships {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .rsm-flagship:nth-child(3) {
    grid-column: 1 / -1;
  }
}
@media (max-width: 640px) {
  .rsm-flagships {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 960px) {
  .rsm-hero-inner {
    grid-template-columns: 1fr;
  }
  .rsm-hero-visual {
    min-height: 0;
    max-width: 32rem;
    width: 100%;
    margin: 0 auto;
    padding-top: 4rem;
  }
  .rsm-pillar-card {
    position: relative;
    width: 100%;
  }
  /* Photo spans the whole stacked hero; the wash keeps the copy readable
     and lets the microscope show through toward the bottom. */
  .rsm-hero-photo {
    inset: 0;
    left: 0;
    background-position: 6% bottom;
    -webkit-mask-image: none;
    mask-image: none;
  }
  .rsm-hero-photo::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
      180deg,
      var(--rh-wash-strong) 0%,
      var(--rh-wash-strong) 62%,
      var(--rh-wash-soft) 85%,
      var(--rh-wash-strong) 100%
    );
  }
}
@media (max-width: 560px) {
  .rsm-btn {
    width: 100%;
    justify-content: center;
  }
  .rsm-pillars {
    padding: 0.35rem;
  }
  .rsm-trust {
    gap: 0.35rem 1rem;
  }
  .rsm-trust li + li::before {
    display: none;
  }
  .rsm-logo-badge {
    width: 4rem;
    top: -3.3rem;
  }
  .rsm-pillar-link {
    font-size: 0.72rem;
  }
  .rsm-pillar-icon {
    width: 2.8rem;
    height: 2.8rem;
  }
}
