/* Section & shell layout — uses tokens from theme.css only */

/* ——— Hero ——— */
.rp-hero {
  position: relative;
  min-height: min(92vh, 57rem);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  /* Visible so nowrap / gradient headline isn’t clipped; image is contained on .rp-hero__media */
  overflow: visible;
  background: var(--color-brand-dark);
}

.rp-hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.rp-hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Optional hero loop: poster img + semi-transparent video (path in assets.heroVideo) */
.rp-hero__media--video .rp-hero__poster,
.rp-hero__media--video .rp-hero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rp-hero__media--video .rp-hero__poster {
  z-index: 0;
}

.rp-hero__media--video .rp-hero__video {
  z-index: 1;
  opacity: 0.42;
  pointer-events: none;
  /* De-blue / warm toward brand: sepia adds warmth; lower sat calms cool casts */
  filter: sepia(0.14) saturate(0.88) hue-rotate(-6deg) contrast(1.02);
}

@media (prefers-reduced-motion: reduce) {
  .rp-hero__media--video .rp-hero__video {
    display: none;
  }
}

/* Same geometry as .rp-cta — sage glow from the right (matches footer-adjacent band) */
.rp-hero__flair {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(
    ellipse 78% 120% at 100% 45%,
    var(--bg-brand-ink-glow) 0%,
    transparent 52%
  );
}

.rp-hero__scrim {
  position: absolute;
  inset: 0;
  z-index: 2;
  /* Sage-tinted veil + right-side glow (pairs with .rp-hero__flair) */
  background:
    radial-gradient(
      ellipse 90% 100% at 86% 38%,
      color-mix(in srgb, var(--color-primary) 30%, transparent) 0%,
      transparent 52%
    ),
    color-mix(in srgb, var(--color-brand-dark) 54%, transparent);
}

.rp-hero__brand {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 4;
  padding: clamp(1rem, 2.5vw, 1.5rem) var(--gutter-x);
  cursor: default;
  line-height: 0;
}

.rp-hero__brand-logo {
  display: block;
  cursor: default;
  pointer-events: none;
  /* Horizontal wordmark: taller cap so it reads at a glance (SVG stays sharp) */
  height: clamp(2.25rem, 7vw, 3.5rem);
  width: auto;
  max-width: min(26rem, 90vw);
}

.rp-hero__inner {
  position: relative;
  z-index: 3;
  width: 100%;
  /* Wider than 48rem: more horizontal room so hero type can scale up while nowrap line 2 still fits */
  max-width: min(92vw, 56rem);
  min-width: 0;
  padding: var(--section-y) var(--gutter-x);
  text-align: center;
  /* Scale headline from this width (cqi) so nowrap line 2 matches the column, not the whole viewport */
  container-type: inline-size;
  container-name: hero;
  /* Allow long nowrap lines to extend past the text column without clipping */
  overflow: visible;
}

.rp-hero__kicker-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  margin-bottom: 1.875rem;
}

.rp-hero__rule {
  width: 5rem;
  height: 1px;
  background: var(--color-on-dark);
  opacity: 0.6;
}

.rp-hero__kicker {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--text-base);
  letter-spacing: var(--tracking-overline);
  text-transform: uppercase;
  color: var(--color-on-dark);
}

@media (max-width: 47.99rem) {
  .rp-hero__kicker {
    display: flex;
    flex-direction: column;
    align-items: center;
    row-gap: 0.3125rem;
  }

  .rp-hero__kicker-part--loc {
    white-space: nowrap;
  }
}

.rp-hero__title {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 700;
  /* vw: fallback when cqi isn’t available. cqi uses column width — can approach 5rem when the band is wide */
  font-size: clamp(1.5rem, 5vw + 1.25rem, 5rem);
  font-size: clamp(1.5rem, 6.5cqi + 1rem, 5rem);
  /* Slightly looser than --leading-tight: background-clip text + tight leading clips glyphs */
  line-height: 1.14;
  letter-spacing: -0.02em;
  color: var(--color-on-dark);
}

.rp-hero__title-line {
  display: block;
}

/* Second headline line — keep on one line (e.g. "& product design") */
.rp-hero__title-line--nowrap {
  white-space: nowrap;
}

.rp-hero__title-accent {
  /* Stronger sage band on the accent line */
  background: linear-gradient(
    92deg,
    color-mix(in srgb, var(--color-on-dark) 70%, transparent) 0%,
    color-mix(in srgb, var(--color-primary) 52%, var(--color-on-dark)) 44%,
    color-mix(in srgb, var(--color-primary) 88%, var(--color-on-dark)) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  /* Extra line-box padding — WebKit often clips gradient text at tight bounds */
  padding-block: 0.06em;
}

/* ——— Intro split ——— */
.rp-intro {
  padding-block: var(--section-y);
  background-color: var(--bg-brand-wash-soft);
  background-image: radial-gradient(
    ellipse 118% 92% at 0% 100%,
    var(--bg-brand-peak-soft) 0%,
    var(--bg-brand-wash-soft) 78%
  );
  background-repeat: no-repeat;
}

.rp-intro__grid {
  display: grid;
  gap: clamp(2rem, 4vw, 3.125rem);
  align-items: start;
}

@media (min-width: 64rem) {
  .rp-intro__grid {
    grid-template-columns: 1.2fr 1fr;
    min-height: 18rem;
  }
}

.rp-intro__lead {
  padding: 0.625rem 0.9375rem;
}

.rp-intro__head {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.625rem;
}

.rp-intro__rule {
  width: 5rem;
  height: 1px;
  background: color-mix(in srgb, var(--color-primary-on-surface) 48%, transparent);
}

.rp-intro__copy {
  padding: 0.625rem;
}

/* ——— Feature cards ——— */
.rp-features {
  padding-block: var(--section-y);
  background-color: var(--bg-brand-wash-soft);
  background-image:
    radial-gradient(circle at 2px 2px, var(--bg-brand-dot) 2px, var(--bg-brand-wash-soft) 2.1px),
    radial-gradient(
      ellipse 118% 92% at 100% 0%,
      var(--bg-brand-peak-soft) 0%,
      var(--bg-brand-wash-soft) 78%
    );
  background-size:
    32px 32px,
    auto;
  background-repeat: repeat, no-repeat;
}

/** Shared section header: overline + title (Clients, Services, Testimonials, …) */
.rp-section-head {
  margin-bottom: 2.5rem;
  text-align: left;
}

.rp-section-label-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.75rem;
}

.rp-section-rule {
  width: 5rem;
  height: 1px;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--color-primary-on-surface) 42%, transparent);
}

.rp-section-overline {
  margin: 0;
}

.rp-section-heading {
  margin: 0;
}

.rp-features__grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 48rem) {
  .rp-features__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.rp-feature-card {
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  padding: clamp(2rem, 4vw, 3.75rem) clamp(1.5rem, 3vw, 2.5rem);
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  border: 1px solid var(--color-border-subtle);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.06);
}

/* ——— Manifesto banner ——— */
.rp-manifesto-banner {
  position: relative;
  padding-block: var(--section-y);
  background-size: cover;
  background-position: center;
  color: var(--color-on-dark);
}

.rp-manifesto-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    270deg,
    var(--color-brand-dark) 0%,
    rgba(0, 0, 0, 0) 55%
  );
}

.rp-manifesto-banner__inner {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: flex-end;
  text-align: right;
}

.rp-manifesto-banner__label {
  margin: 0 0 0.5rem;
}

.rp-manifesto-banner__title {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-2xl);
  line-height: var(--leading-snug);
  color: var(--color-on-dark);
}

/* ——— Principles (dark panel + list) ——— */
.rp-principles {
  display: grid;
}

@media (min-width: 64rem) {
  .rp-principles {
    grid-template-columns: minmax(0, 37.5rem) 1fr;
    min-height: 28rem;
  }
}

.rp-principles__panel {
  background: var(--color-brand-dark);
  padding: clamp(2rem, 5vw, 5rem) clamp(1.5rem, 4vw, 2.5rem);
  color: var(--color-on-dark);
}

.rp-principles__intro {
  margin: 0 0 2rem;
}

.rp-principles__item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.625rem;
  margin-bottom: 1.875rem;
}

.rp-principles__item:last-child {
  margin-bottom: 0;
}

.rp-principles__num {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(2.5rem, 5vw, 3.75rem);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px var(--color-on-dark-muted);
}

.rp-principles__item-title {
  margin: 0 0 0.375rem;
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 1.0625rem;
  line-height: 1.45;
  letter-spacing: 0.05em;
  color: var(--color-on-dark);
}

.rp-principles__item-body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--text-base);
  line-height: 1.47;
  color: var(--color-on-dark-muted);
}

.rp-principles__visual {
  min-height: 16rem;
  background-size: cover;
  background-position: center;
}

/* ——— Work strip ——— */
.rp-work {
  padding-block: var(--section-y);
  background: var(--color-surface-soft);
  overflow: hidden;
}

.rp-work__head {
  margin-bottom: 2.5rem;
}

.rp-work__intro {
  margin: 1rem 0 0;
  max-width: 42rem;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--text-base);
  line-height: var(--leading-body);
  color: var(--color-ink-muted);
}

.rp-work__track-wrap {
  margin-inline: calc(-1 * var(--gutter-x));
  padding-inline: var(--gutter-x);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

.rp-work__track {
  display: flex;
  gap: 1.5rem;
  padding-bottom: 0.5rem;
}

.rp-work-card {
  flex: 0 0 min(85vw, 28rem);
  scroll-snap-align: start;
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.rp-work-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rp-work-card__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    var(--color-overlay-gradient-end) 0%,
    transparent 55%
  );
}

.rp-work-card__meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 3.125rem;
  z-index: 1;
}

.rp-work-card__label {
  margin: 0 0 0.625rem;
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: var(--text-sm);
  line-height: 1.2;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-on-dark);
}

.rp-work-card__title {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-lg);
  line-height: var(--leading-snug);
  color: var(--color-on-dark);
}

/* ——— Insights (cards) ——— */
.rp-insights {
  padding-block: var(--section-y);
  background-color: var(--bg-brand-wash);
  background-image: radial-gradient(
    ellipse 102% 88% at 10% 0%,
    var(--bg-brand-peak) 0%,
    var(--bg-brand-wash) 82%
  );
  background-repeat: no-repeat;
}

.rp-insights__head {
  margin-bottom: 2.5rem;
}

.rp-insights__grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 48rem) {
  .rp-insights__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.rp-insight-card {
  display: flex;
  flex-direction: column;
  background: var(--color-surface-soft);
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--color-border-subtle);
  transition: box-shadow 0.2s;
}

.rp-insight-card:hover {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

.rp-insight-card__media {
  aspect-ratio: 16 / 11;
  overflow: hidden;
}

.rp-insight-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rp-insight-card__body {
  padding: 1.5rem 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.rp-insight-card__date {
  margin: 0 0 0.5rem;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-ink-subtle);
}

.rp-insight-card__title {
  margin: 0 0 1rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-md);
  line-height: 1.35;
  color: var(--color-ink);
}

.rp-insight-card__link {
  margin-top: auto;
  font-family: var(--font-label);
  font-weight: 700;
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-primary-on-surface);
  text-decoration: none;
}

.rp-insight-card__link:hover {
  text-decoration: underline;
}

/* ——— Testimonial carousel (“Working with Me”) ——— */
.rp-testimonial {
  padding-block: var(--section-y);
  background-color: var(--color-surface);
}

.rp-testimonial__head {
  max-width: 42rem;
}

@media (min-width: 64rem) {
  .rp-testimonial__head {
    max-width: none;
  }

  .rp-testimonial__intro {
    white-space: nowrap;
  }
}

.rp-testimonial__intro {
  margin: 0.75rem 0 0;
  font-size: var(--text-base);
  line-height: var(--leading-body);
  color: var(--color-ink-subtle);
}

.rp-testimonial__carousel {
  outline: none;
}

.rp-testimonial__viewport {
  overflow: hidden;
  width: 100%;
  border-radius: var(--radius-sm);
  transition: height 0.35s ease;
}

.rp-testimonial__track {
  display: flex;
  align-items: flex-start;
  transition: transform 0.4s ease;
}

@media (prefers-reduced-motion: reduce) {
  .rp-testimonial__viewport,
  .rp-testimonial__track {
    transition: none;
  }
}

.rp-testimonial__slide {
  box-sizing: border-box;
}

.rp-testimonial__quote-wrap {
  background: var(--color-surface);
  padding: clamp(1.5rem, 3vw, 2.5rem);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-subtle);
  margin: 0 0 1.25rem;
}

.rp-testimonial__quote-wrap .rp-type-quote {
  margin: 0 0 1rem;
}

.rp-testimonial__quote-wrap .rp-type-quote:last-child {
  margin-bottom: 0;
}

.rp-testimonial__attrib {
  padding-left: 0.25rem;
}

.rp-testimonial__name {
  margin: 0 0 0.25rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-md);
}

.rp-testimonial__role {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--text-sm);
  line-height: var(--leading-body);
  color: var(--color-ink-subtle);
}

.rp-testimonial__toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.rp-testimonial__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: 1px solid var(--color-border-subtle);
  background: var(--color-surface);
  color: var(--color-ink);
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}

.rp-testimonial__btn:hover {
  background: var(--color-surface-soft);
  border-color: var(--color-primary-on-surface);
}

.rp-testimonial__btn:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
}

.rp-testimonial__btn-text {
  position: relative;
  top: -0.05em;
}

.rp-testimonial__dots {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.rp-testimonial__dot {
  width: 0.5rem;
  height: 0.5rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: color-mix(in srgb, var(--color-ink) 25%, transparent);
  cursor: pointer;
  transition:
    transform 0.15s ease,
    background 0.15s ease;
}

.rp-testimonial__dot[aria-current="true"] {
  background: var(--color-primary-on-surface);
  transform: scale(1.25);
}

.rp-testimonial__dot:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
}

/* ——— Partners (bordered logo grid) ——— */
.rp-partners {
  padding-block: var(--section-y);
  background-color: var(--color-surface);
}

.rp-partners__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--color-partner-grid-line);
  background: var(--color-partner-grid-line);
}

/* Four columns × two rows at larger breakpoints (eight logos) */
@media (min-width: 64rem) {
  .rp-partners__grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.rp-partners__cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 6.5rem;
  padding: clamp(1.5rem, 4vw, 2.75rem) clamp(1.25rem, 3vw, 2rem);
  background: var(--color-surface);
}

.rp-partners__logo {
  width: auto;
  max-width: min(100%, 12.5rem);
  height: auto;
  max-height: 3.25rem;
  object-fit: contain;
  opacity: 0.3;
  transition: opacity 0.2s;
}

/* Color logos → single black treatment for the grid */
.rp-partners__logo--mono {
  filter: grayscale(1) brightness(0);
}

/* Already black/white art (e.g. white type on black). Never use brightness(0) — it wipes the text. */
.rp-partners__logo--native-bw {
  max-width: min(100%, 12rem);
  max-height: 3.5rem;
  width: auto;
  height: auto;
  object-fit: contain;
}

.rp-partners__cell:hover .rp-partners__logo {
  opacity: 1;
}

/* ——— CTA band ——— */
.rp-cta {
  padding-block: clamp(3rem, 6vw, 4.5rem);
  background-color: var(--color-brand-dark);
  background-image: radial-gradient(
    ellipse 78% 120% at 100% 45%,
    var(--bg-brand-ink-glow) 0%,
    var(--color-brand-dark) 52%
  );
  background-repeat: no-repeat;
  color: var(--color-on-dark);
}

/* CTA copy + button, then footer — one continuous band (no hard line between). */
.rp-cta__shell {
  display: flex;
  flex-direction: column;
  gap: clamp(1.75rem, 4vw, 2.75rem);
}

.rp-cta__inner {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: flex-start;
  justify-content: space-between;
}

@media (min-width: 48rem) {
  .rp-cta__inner {
    flex-direction: row;
    align-items: center;
  }
}

.rp-cta__copy {
  max-width: 36rem;
}

.rp-cta__title {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  line-height: var(--leading-snug);
  color: var(--color-on-dark);
}

.rp-cta__sub {
  margin: 0.75rem 0 0;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--text-base);
  line-height: var(--leading-body);
  /* Same as title: --color-on-dark-muted fails AA on black */
  color: var(--color-on-dark);
}

.rp-cta__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 1.75rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-primary);
  background: transparent;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--text-sm);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-on-dark);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.rp-cta__btn:hover,
.rp-cta__btn:focus-visible {
  background: var(--color-primary);
  color: var(--color-on-dark);
}

.rp-cta__btn:focus-visible {
  /* Light brand green — readable on dark CTA band (on-surface ring would disappear here) */
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ——— Site footer ——— */
.rp-site-footer {
  padding-block: 2.5rem;
  border-top: 1px solid var(--color-border-subtle);
  background: var(--color-brand-dark);
  /* Light text on black — WCAG AA+ (use --color-on-dark, not --color-on-dark-muted) */
  color: var(--color-on-dark);
}

/* Merged into `.rp-cta` — same visual surface, no top rule (mobile-friendly). */
.rp-site-footer--in-cta {
  padding-block: 0;
  margin: 0;
  border-top: none;
  background: transparent;
}

.rp-site-footer__inner {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  align-items: flex-start;
  justify-content: space-between;
}

@media (min-width: 40rem) {
  .rp-site-footer__inner {
    flex-direction: row;
    align-items: center;
  }
}

.rp-site-footer__brand {
  cursor: default;
  line-height: 0;
}

.rp-site-footer__logo {
  display: block;
  /* Taller floor on narrow viewports so the horizontal wordmark reads clearly */
  height: clamp(2.125rem, 6vw, 2.5rem);
  width: auto;
  max-width: min(22rem, 92vw);
  cursor: default;
  pointer-events: none;
}

.rp-site-footer__meta {
  margin: 0;
  font-size: var(--text-sm);
}

.rp-site-footer a {
  color: var(--color-primary);
  text-decoration: none;
}

.rp-site-footer a:hover {
  text-decoration: underline;
}
