/* ==========================================================================
   Ruffiliate home page. Shared tokens, nav, footer, buttons and primitives
   live in rf.css; this file holds only the home composition.
   ========================================================================== */

/* ── Hero ─────────────────────────────────────────────────────────────── */

.rf-hero {
  position: relative;
  padding-top: 152px;
  isolation: isolate;
}

.rf-hero__field {
  position: absolute;
  inset: 0 0 auto 0;
  height: 820px;
  z-index: -1;
  background: var(--field);
  background-size: 140% 140%;
  background-position: 0% 0%;
  clip-path: polygon(0 0, 100% 0, 100% 56%, 0 100%);
}

.rf-hero__field::after {
  /* faint vertical light columns, after the flowninja panel rhythm */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0 34%, rgba(255, 255, 255, 0.035) 34% 58%, transparent 58% 80%, rgba(255, 255, 255, 0.05) 80% 100%);
  pointer-events: none;
}

.rf-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: 56px;
  align-items: start;
}

.rf-hero__copy {
  padding-bottom: 72px;
}

.rf-hero__title {
  margin: 0 0 28px;
  max-width: 13ch;
  font-size: clamp(3rem, 6.6vw, 5.75rem);
  line-height: 0.98;
  font-weight: 600;
  letter-spacing: -0.045em;
  color: #f3f9f6;
  text-wrap: balance;
}

.rf-hero__lede {
  margin: 0 0 36px;
  max-width: 44ch;
  font-size: clamp(1.0625rem, 1.4vw, 1.25rem);
  line-height: 1.55;
  color: rgba(226, 243, 235, 0.86);
}

.rf-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Instrument card */

.rf-instrument {
  margin: 72px 0 0;
  padding: 28px;
  border-radius: var(--r-module);
  background: var(--clay-face);
  border: 1px solid var(--edge);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 40px 80px -30px rgba(2, 25, 17, 0.55), 0 12px 24px -12px rgba(2, 25, 17, 0.25);
}

html[data-theme="dark"] .rf-instrument {
  box-shadow: 0 1px 0 rgba(190, 240, 215, 0.06) inset, 0 40px 80px -30px rgba(0, 0, 0, 0.8);
}

.rf-instrument__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 24px;
}

.rf-instrument__title {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--ink);
}

.rf-instrument__meta {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--ink-3);
}

.rf-instrument__hero-num {
  display: grid;
  gap: 6px;
  margin-bottom: 24px;
}

.rf-num--xl {
  font-size: clamp(3rem, 5vw, 4rem);
  line-height: 1;
  font-weight: 500;
  color: var(--ink);
}

.rf-num__unit {
  font-size: 0.5em;
  margin-left: 2px;
  color: var(--ink-3);
}

.rf-instrument__hero-label {
  color: var(--ink-2);
  font-size: 0.9375rem;
  max-width: 30ch;
}

.rf-split {
  display: flex;
  gap: 4px;
  height: 22px;
  padding: 5px;
  border-radius: 999px;
  background: var(--clay);
  box-shadow: var(--press-sm);
  margin-bottom: 20px;
}

.rf-split__seg {
  width: var(--w);
  border-radius: 999px;
  transform-origin: left center;
}

.rf-split__seg--a { background: var(--seg-a); }
.rf-split__seg--b { background: var(--seg-b); }
.rf-split__seg--c { background: var(--seg-c); }

.rf-legend {
  margin: 0;
  display: grid;
  gap: 2px;
}

.rf-legend__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid rgba(60, 90, 78, 0.12);
}

html[data-theme="dark"] .rf-legend__row {
  border-top-color: rgba(190, 240, 215, 0.07);
}

.rf-legend dt {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-2);
  font-size: 0.9375rem;
}

.rf-legend dd {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 12px;
  color: var(--ink);
  font-weight: 500;
}

.rf-legend__count {
  min-width: 4ch;
  text-align: right;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--ink-3);
}

.rf-swatch {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.rf-swatch--a { background: var(--seg-a); }
.rf-swatch--b { background: var(--seg-b); }
.rf-swatch--c { background: var(--seg-c); box-shadow: inset 0 0 0 1px rgba(60, 90, 78, 0.25); }

/* ── Findings ─────────────────────────────────────────────────────────── */

.rf-findings__grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 56px;
  align-items: center;
}

.rf-findings__panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 12px;
}

.rf-stat {
  padding: 28px;
}

.rf-stat + .rf-stat {
  position: relative;
}

.rf-stat:nth-child(2),
.rf-stat:nth-child(4) {
  box-shadow: inset 2px 0 0 -1px var(--lo);
}

.rf-stat:nth-child(3),
.rf-stat:nth-child(4) {
  border-top: 1px solid rgba(60, 90, 78, 0.12);
}

html[data-theme="dark"] .rf-stat:nth-child(3),
html[data-theme="dark"] .rf-stat:nth-child(4) {
  border-top-color: rgba(190, 240, 215, 0.07);
}

.rf-num--lg {
  display: block;
  margin-bottom: 10px;
  font-size: clamp(2rem, 3.4vw, 2.75rem);
  line-height: 1;
  font-weight: 500;
  color: var(--ink);
}

.rf-stat p {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.9375rem;
  max-width: 34ch;
}

/* ── Explore bento ────────────────────────────────────────────────────── */

.rf-explore__title {
  margin-bottom: 36px;
}

.rf-bento {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 28px;
}

.rf-feature {
  grid-column: span 7;
  grid-row: span 2;
  position: relative;
  overflow: hidden;
  display: flex;
  min-height: 480px;
  border-radius: var(--r-module);
  background: linear-gradient(100deg, #03140d 0%, #082f22 34%, #136b4c 66%, #5cc799 88%, #a7efcd 100%);
  color: #f1f8f4;
  text-decoration: none;
  isolation: isolate;
  box-shadow: 0 30px 60px -30px rgba(3, 30, 20, 0.55);
  transition: transform 400ms var(--ease-out), box-shadow 400ms var(--ease-out);
}

.rf-feature:hover {
  transform: translateY(-3px);
  box-shadow: 0 40px 70px -30px rgba(3, 30, 20, 0.6);
}

.rf-feature__blocks,
.rf-feature__blocks::before,
.rf-feature__blocks::after {
  position: absolute;
  pointer-events: none;
}

.rf-feature__blocks {
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.32) 0 24%, transparent 24% 100%);
}

.rf-feature__blocks::before {
  content: "";
  top: 0;
  right: 0;
  width: 34%;
  height: 34%;
  border-bottom-left-radius: 14px;
  background: linear-gradient(90deg, rgba(4, 30, 20, 0.6), rgba(10, 60, 42, 0.25));
}

.rf-feature__blocks::after {
  content: "";
  left: 48%;
  right: 0;
  bottom: 0;
  height: 26%;
  background: linear-gradient(90deg, rgba(160, 240, 205, 0.0), rgba(190, 250, 222, 0.32));
}

.rf-feature__body {
  display: flex;
  flex-direction: column;
  padding: 40px;
  width: 100%;
}

.rf-feature__title {
  font-size: clamp(2rem, 3.6vw, 3.25rem);
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.04em;
  margin-bottom: 18px;
  max-width: 12ch;
}

.rf-feature__text {
  max-width: 38ch;
  color: rgba(226, 244, 235, 0.88);
  font-size: 1.0625rem;
  margin-bottom: 28px;
}

.rf-feature__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 460px;
  margin-bottom: auto;
}

.rf-pill {
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 0.9375rem;
  color: #e9f6ef;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 6px 14px -8px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.rf-feature__cta {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 36px;
  height: 52px;
  padding: 0 28px;
  border-radius: 999px;
  background: #f4f9f6;
  color: #052117;
  font-weight: 600;
}

.rf-feature__cta .ph {
  transition: transform 300ms var(--ease-out);
}

.rf-feature:hover .rf-feature__cta .ph {
  transform: translateX(4px);
}

.rf-tile {
  grid-column: span 5;
  padding: 28px;
  display: flex;
  flex-direction: column;
}

.rf-tile__lead {
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  margin-bottom: 10px;
  border-radius: var(--r-well);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--raise-sm);
  transition: box-shadow 260ms var(--ease-out);
}

.rf-tile__lead:hover {
  box-shadow: var(--press-sm);
}

.rf-tile__sub {
  font-weight: 400;
  font-size: 0.875rem;
  color: var(--ink-2);
}

.rf-tile__note {
  margin: auto 0 0;
  padding-top: 14px;
  font-size: 0.875rem;
  color: var(--ink-3);
}

.rf-rows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}

.rf-rows a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
  border-radius: 999px;
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.9375rem;
  transition: box-shadow 240ms var(--ease-out), color 180ms ease;
}

.rf-rows a .ph {
  color: var(--ink-3);
  transition: transform 260ms var(--ease-out), color 180ms ease;
}

.rf-rows a .rf-num {
  color: var(--accent);
  font-size: 0.875rem;
}

.rf-rows a:hover {
  color: var(--ink);
  box-shadow: var(--press-sm);
}

.rf-rows a:hover .ph {
  color: var(--accent);
  transform: translate(2px, -2px);
}

.rf-datarow {
  grid-column: 1 / -1;
  padding: 28px;
}

.rf-datarow__title {
  margin-bottom: 20px;
}

.rf-keys {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 18px;
}

.rf-key {
  display: grid;
  gap: 6px;
  padding: 18px 22px;
  border-radius: var(--r-well);
  background: var(--clay-face);
  border: 1px solid var(--edge);
  box-shadow: var(--raise-sm);
  color: var(--ink);
  text-decoration: none;
  transition: box-shadow 260ms var(--ease-out), transform 260ms var(--ease-out);
}

.rf-keys li {
  display: flex;
}

.rf-key {
  flex: 1;
}

.rf-key--static {
  background: transparent;
  border-color: transparent;
  box-shadow: inset 0 0 0 1px rgba(60, 90, 78, 0.14);
}

html[data-theme="dark"] .rf-key--static {
  box-shadow: inset 0 0 0 1px rgba(190, 240, 215, 0.08);
}

a.rf-key:hover {
  box-shadow: var(--press-sm);
}

a.rf-key:active {
  transform: scale(0.98);
}

.rf-key__name {
  font-weight: 600;
}

.rf-key__value {
  color: var(--ink-3);
  font-size: 0.875rem;
}

.rf-key__value .rf-num {
  color: var(--accent);
  font-size: 1rem;
  font-weight: 500;
}

/* ── Method ───────────────────────────────────────────────────────────── */

.rf-method__grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 64px;
  align-items: start;
}

.rf-prose p {
  margin: 0 0 18px;
  max-width: 66ch;
  color: var(--ink-2);
  font-size: 1.0625rem;
  line-height: 1.7;
}

.rf-prose strong {
  color: var(--ink);
  font-weight: 600;
}

.rf-prose a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent-soft);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  transition: color 160ms ease;
}

.rf-prose a:hover {
  color: var(--accent);
}

.rf-stance {
  position: sticky;
  top: 32px;
  padding: 32px;
}

.rf-stance__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 18px;
}

.rf-stance__list li {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 14px;
  align-items: start;
  color: var(--ink-2);
  font-size: 0.9875rem;
}

.rf-stance__list .ph {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  font-size: 1.1rem;
  color: var(--accent);
  background: var(--clay-face);
  box-shadow: var(--raise-sm);
}

/* ── Measures ─────────────────────────────────────────────────────────── */

.rf-dials {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 10px;
  margin-bottom: clamp(56px, 7vw, 88px);
}

.rf-dial {
  padding: 30px 28px;
}

.rf-dial + .rf-dial {
  box-shadow: inset 2px 0 0 -1px var(--lo);
}

.rf-dial__icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 20px;
  border-radius: 999px;
  font-size: 1.4rem;
  color: var(--accent);
  background: var(--clay);
  box-shadow: var(--press-sm);
}

.rf-dial__title {
  margin: 0 0 8px;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.rf-dial p {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.9375rem;
  max-width: 36ch;
}

.rf-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
}

.rf-columns .rf-h2 {
  font-size: clamp(1.5rem, 2.4vw, 2rem);
}

/* ── Browse band ──────────────────────────────────────────────────────── */

.rf-browse {
  position: relative;
  margin-top: clamp(80px, 10vw, 140px);
  padding: 200px 0 120px;
  isolation: isolate;
  color: #f1f8f4;
}

.rf-browse__field {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--field);
  background-size: 140% 140%;
  background-position: 100% 100%;
  clip-path: polygon(0 26%, 100% 0, 100% 100%, 0 100%);
}

.rf-browse__title {
  margin: 0 0 40px;
  max-width: 16ch;
  font-size: clamp(2rem, 4.4vw, 3.5rem);
  line-height: 1.02;
  font-weight: 600;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.rf-browse__links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.rf-glass {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 28px 64px 28px 28px;
  border-radius: var(--r-module);
  color: #f1f8f4;
  text-decoration: none;
  background: rgba(3, 25, 17, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 20px 40px -24px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: background-color 260ms ease, transform 360ms var(--ease-out);
}

.rf-glass:hover {
  background: rgba(3, 25, 17, 0.5);
  transform: translateY(-3px);
}

.rf-glass__title {
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.rf-glass__text {
  color: rgba(226, 244, 235, 0.86);
  font-size: 0.9375rem;
}

.rf-glass__arrow {
  position: absolute;
  top: 28px;
  right: 26px;
  font-size: 1.25rem;
  transition: transform 300ms var(--ease-out);
}

.rf-glass:hover .rf-glass__arrow {
  transform: translateX(4px);
}

/* ── Motion: one authored load moment ─────────────────────────────────── */

@media (prefers-reduced-motion: no-preference) {
  .rf-hero__field {
    animation: rf-drift 28s ease-in-out infinite alternate;
  }

  .rf-hero__title,
  .rf-hero__lede,
  .rf-hero__actions {
    animation: rf-rise 900ms var(--ease-out) both;
  }

  .rf-hero__lede { animation-delay: 80ms; }
  .rf-hero__actions { animation-delay: 160ms; }

  .rf-instrument {
    animation: rf-float-in 1100ms var(--ease-out) 120ms both;
  }

  .rf-split__seg {
    animation: rf-grow 1200ms var(--ease-out) both;
  }

  .rf-split__seg--a { animation-delay: 450ms; }
  .rf-split__seg--b { animation-delay: 560ms; }
  .rf-split__seg--c { animation-delay: 670ms; }
}

@keyframes rf-float-in {
  from { opacity: 0; transform: translateY(32px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

@keyframes rf-grow {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* ── Responsive ───────────────────────────────────────────────────────── */

@media (max-width: 1024px) {
  .rf-hero__grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .rf-hero__copy {
    padding-bottom: 0;
  }

  .rf-hero__title {
    max-width: 14ch;
  }

  .rf-instrument {
    max-width: 520px;
  }

  .rf-hero__field {
    height: 78%;
    clip-path: polygon(0 0, 100% 0, 100% 82%, 0 100%);
  }

  .rf-findings__grid,
  .rf-method__grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .rf-stance {
    position: static;
  }

  .rf-feature,
  .rf-tile {
    grid-column: 1 / -1;
  }

  .rf-feature {
    grid-row: auto;
    min-height: 420px;
  }

  .rf-tile {
    grid-column: span 6;
  }

}

@media (max-width: 767px) {
  .rf-hero {
    padding-top: 112px;
  }

  .rf-hero__title {
    font-size: clamp(2.6rem, 11vw, 3.4rem);
    margin-bottom: 20px;
  }

  .rf-hero__lede {
    margin-bottom: 28px;
  }

  .rf-instrument {
    margin-top: 40px;
    padding: 22px;
  }

  .rf-findings__panel,
  .rf-dials,
  .rf-columns,
  .rf-browse__links {
    grid-template-columns: 1fr;
  }

  .rf-stat {
    padding: 22px 18px;
  }

  .rf-stat:nth-child(n) {
    box-shadow: none;
    border-top: 1px solid rgba(60, 90, 78, 0.12);
  }

  .rf-stat:first-child {
    border-top: 0;
  }

  .rf-dial + .rf-dial {
    box-shadow: inset 0 2px 0 -1px var(--lo);
  }

  .rf-bento {
    gap: 20px;
  }

  .rf-tile {
    grid-column: 1 / -1;
    padding: 22px;
  }

  .rf-feature__body {
    padding: 28px 22px;
  }

  .rf-datarow {
    padding: 22px 18px;
  }

  .rf-keys {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .rf-key {
    padding: 16px;
  }

  .rf-columns {
    gap: 40px;
  }

  .rf-browse {
    padding: 140px 0 80px;
  }

  .rf-browse__field {
    clip-path: polygon(0 12%, 100% 0, 100% 100%, 0 100%);
  }
}
