/**
 * Hero chapter — full-bleed graded photography under a graphite scrim,
 * blueprint grid, vignette and grain, with pointer parallax on four layers.
 *
 * Slide 1 ships visible and complete; slides 2 and 3 carry `hidden` in the
 * markup, so with no JS the page is one correct, crawlable hero.
 */

.rm-hero {
  position: relative;
  isolation: isolate;
  min-height: 100dvh;
  display: grid;
  overflow: hidden;
}

.rm-hero__stage {
  position: relative;
  grid-area: 1 / 1;
  display: grid;
}

.rm-hero__slide {
  grid-area: 1 / 1;
  position: relative;
  display: grid;
  align-content: end;
  min-height: 100dvh;
}

.rm-hero__slide[hidden] {
  display: none;
}

/* ---- Layered visual ----------------------------------------------------- */

.rm-hero__visual {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.rm-hero__media {
  position: absolute;
  inset: -3% -3%;
}

/**
 * The frame exists so three things can move independently without fighting:
 * the media layer takes pointer parallax, the frame takes the slow drift, and
 * the image itself takes the slide-transition scale.
 */
.rm-hero__frame {
  width: 100%;
  height: 100%;
}

.rm-hero__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
}

@media (prefers-reduced-motion: no-preference) {
  .rm-hero__slide.is-active .rm-hero__frame {
    animation: rm-hero-drift 32s var(--rm-ease-in-out) infinite alternate;
  }
}

@keyframes rm-hero-drift {
  from {
    transform: scale(1) translate3d(0, 0, 0);
  }
  to {
    transform: scale(1.06) translate3d(0.6%, -0.8%, 0);
  }
}

/**
 * Graphite scrim. The copy has to win, but the photograph still has to be
 * legible as a photograph, so the scrim is heavy where the text sits (lower
 * left) and thin where the frame is doing the work.
 */
.rm-hero__scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(11, 12, 14, 0.6) 0%, rgba(11, 12, 14, 0.12) 26%, rgba(11, 12, 14, 0.88) 100%),
    linear-gradient(96deg, rgba(11, 12, 14, 0.88) 0%, rgba(11, 12, 14, 0.52) 34%, rgba(11, 12, 14, 0.16) 68%, rgba(11, 12, 14, 0.32) 100%);
}

/* The hero photograph carries more of its own tone than the section plates. */
.rm-hero__media.rm-media--graded img {
  filter: grayscale(0.86) contrast(1.12) brightness(1.02);
}

.rm-hero__media.rm-media--graded::after {
  opacity: 0.3;
}

.rm-hero__gridlines {
  inset: -6%;
  mask-image: radial-gradient(ellipse 90% 80% at 22% 68%, transparent 12%, #000 72%);
}

.rm-hero__vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 96% 84% at 30% 56%, transparent 34%, rgba(11, 12, 14, 0.5) 100%);
}

/* Fine grain over everything: fixed, non-interactive, never on a scroller. */
.rm-hero__grain {
  position: absolute;
  inset: 0;
  opacity: 0.16;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Dimension notation, bottom right of the frame. */
.rm-hero__tech {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.rm-hero__tech-frame {
  position: absolute;
  inset: 1.25rem;
  border: 1px solid rgba(244, 245, 243, 0.09);
  border-radius: var(--rm-radius-sm);
}

.rm-hero__tech-meta {
  position: absolute;
  right: 2.25rem;
  top: 6.75rem;
  display: grid;
  justify-items: end;
  gap: 0.375rem;
  text-align: right;
}

.rm-hero__tech-num {
  font-family: var(--rm-font-mono);
  font-size: 0.8125rem;
  color: var(--rm-signal);
  letter-spacing: var(--rm-tracking-mono);
}

/* ---- Copy --------------------------------------------------------------- */

.rm-hero__content {
  position: relative;
  z-index: 1;
  padding-top: calc(6.5rem + var(--rm-space-8));
  padding-bottom: calc(var(--rm-space-9) + 3rem);
}

.rm-hero__copy {
  display: grid;
  justify-items: start;
  gap: var(--rm-space-5);
  max-width: var(--rm-container-measure);
}

.rm-hero__title {
  margin: 0;
  font-family: var(--rm-font-display);
  font-size: var(--rm-text-display);
  font-weight: var(--rm-weight-display);
  line-height: var(--rm-leading-display);
  letter-spacing: var(--rm-tracking-display);
  color: var(--rm-text-invert);
  max-width: 22ch;
  text-wrap: balance;
}

.rm-hero__desc {
  margin: 0;
  color: rgba(244, 245, 243, 0.76);
  font-size: var(--rm-text-body-lg);
  max-width: 56ch;
}

.rm-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--rm-space-3);
  margin-top: var(--rm-space-2);
}

/* ---- Measured indicator rail ------------------------------------------- */

.rm-hero__rail {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding-bottom: var(--rm-space-6);
}

.rm-hero__rail-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--rm-space-5);
}

.rm-hero__meter {
  display: flex;
  align-items: flex-end;
  gap: var(--rm-space-4);
}

.rm-hero__tick {
  display: grid;
  gap: 0.5rem;
  width: 4.25rem;
  min-height: 2.75rem;
  padding: 0.5rem 0 0;
  border: 0;
  background: none;
  cursor: pointer;
  text-align: left;
  color: rgba(244, 245, 243, 0.42);
  transition: color 300ms var(--rm-ease-expo);
}

.rm-hero__tick:hover,
.rm-hero__tick:focus-visible {
  color: var(--rm-text-invert);
}

.rm-hero__tick.is-active {
  color: var(--rm-text-invert);
}

.rm-hero__tick-num {
  font-family: var(--rm-font-mono);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: var(--rm-tracking-mono);
}

.rm-hero__tick-rule {
  position: relative;
  display: block;
  height: 2px;
  border-radius: 2px;
  background: rgba(244, 245, 243, 0.2);
  overflow: hidden;
}

.rm-hero__tick-fill {
  position: absolute;
  inset: 0;
  transform: scaleX(0);
  transform-origin: left center;
  background: var(--rm-signal);
}

.rm-hero__tick.is-active .rm-hero__tick-rule {
  background: rgba(244, 245, 243, 0.28);
}

/* ---- Arrows ------------------------------------------------------------- */

.rm-hero__arrows {
  display: flex;
  gap: var(--rm-space-2);
}

.rm-hero__arrow {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--rm-rule-invert);
  border-radius: var(--rm-radius-pill);
  background: rgba(11, 12, 14, 0.4);
  color: rgba(244, 245, 243, 0.72);
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition:
    color 260ms var(--rm-ease-expo),
    border-color 260ms var(--rm-ease-expo),
    background-color 260ms var(--rm-ease-expo);
}

.rm-hero__arrow:hover {
  color: var(--rm-ink-900);
  background: var(--rm-signal);
  border-color: var(--rm-signal);
}

.rm-hero__arrow svg {
  width: 1.125rem;
  height: 1.125rem;
}

.rm-hero__arrow--prev svg {
  transform: rotate(180deg);
}

/* ---- Responsive --------------------------------------------------------- */

@media (max-width: 767px) {
  .rm-hero__tech-frame,
  .rm-hero__tech-meta {
    display: none;
  }

  .rm-hero__content {
    padding-top: calc(5.5rem + var(--rm-space-7));
    padding-bottom: calc(var(--rm-space-9) + 2rem);
  }

  .rm-hero__title {
    max-width: 18ch;
  }

  .rm-hero__actions .rm-btn {
    width: 100%;
  }

  .rm-hero__arrows {
    display: none;
  }

  .rm-hero__tick {
    width: 3.25rem;
  }
}

@media (min-width: 1024px) {
  .rm-hero__title {
    max-width: 20ch;
  }

  .rm-hero__rail {
    padding-bottom: var(--rm-space-7);
  }
}

@media (prefers-reduced-transparency: reduce) {
  .rm-hero__arrow {
    background: var(--rm-ink-800);
    backdrop-filter: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rm-hero__grain {
    display: none;
  }
}

/* ---- Landing banner (single frame, shorter than homepage) --------------- */

.rm-hero--banner,
.rm-hero--banner .rm-hero__slide {
  min-height: clamp(26rem, 62vh, 36rem);
}

.rm-hero--banner .rm-hero__content {
  /* Clear the floating header only — no extra band above the copy. */
  padding-top: calc(4.75rem + var(--rm-space-6));
  padding-bottom: var(--rm-space-8);
}

.rm-hero--banner .rm-hero__title {
  font-size: var(--rm-text-h1);
  max-width: 16ch;
}

.rm-hero--banner .rm-hero__desc {
  max-width: 48ch;
}

.rm-hero--banner .rm-hero__price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 0.75rem;
  margin: 0;
}

.rm-hero--banner .rm-hero__price-value {
  font-size: clamp(1.25rem, 1rem + 1vw, 1.625rem);
  color: var(--rm-signal);
  letter-spacing: 0.02em;
}

.rm-hero--banner .rm-hero__price-suffix {
  font-size: var(--rm-text-body-sm);
  color: rgba(244, 245, 243, 0.72);
}

.rm-hero--banner .rm-hero__caveat {
  margin: -0.35rem 0 0;
  font-size: var(--rm-text-caption);
  font-style: italic;
  color: rgba(244, 245, 243, 0.58);
}

.rm-hero--banner .rm-hero__tech-meta {
  top: 5.5rem;
}

@media (max-width: 767px) {
  .rm-hero--banner,
  .rm-hero--banner .rm-hero__slide {
    min-height: clamp(24rem, 68vh, 32rem);
  }

  .rm-hero--banner .rm-hero__content {
    padding-top: calc(4.25rem + var(--rm-space-5));
    padding-bottom: var(--rm-space-7);
  }
}
