/* ==========================================================================
   Ruffiliate design system: "Soft Instrument"
   Neumorphic clay surfaces (raised modules, pressed wells) on a cool mint-grey
   base, framed by a Stripe-style diagonal gradient field in a forest-to-mint
   palette. One accent family (green). Radius rule: modules 28px, wells 20px,
   every interactive control is a full pill.
   ========================================================================== */

:root {
  --clay: #e3e9e6;
  --clay-face: linear-gradient(150deg, #eaf0ed 0%, #dfe6e3 100%);
  --hi: rgba(255, 255, 255, 0.92);
  --lo: rgba(38, 70, 58, 0.2);
  --lo-strong: rgba(26, 54, 44, 0.28);
  --edge: rgba(255, 255, 255, 0.62);

  --ink: #0f1f19;
  --ink-2: #3c4f47;
  --ink-3: #56685f;
  --accent: #0a6a49;
  --accent-soft: #2f9e74;

  --btn-bg: #0b2e23;
  --btn-ink: #f1f7f4;
  --line: rgba(60, 90, 78, 0.14);
  --tint: rgba(60, 90, 78, 0.06);
  --accent-tint: rgba(10, 106, 73, 0.1);

  --seg-a: #0b4a36;
  --seg-b: #34b07f;
  --seg-c: #c3d1cb;

  --field: radial-gradient(60% 80% at 92% 8%, #a6f1cc 0%, rgba(166, 241, 204, 0) 60%),
    radial-gradient(50% 70% at 70% 70%, #2aa476 0%, rgba(42, 164, 118, 0) 65%),
    radial-gradient(70% 90% at 8% 0%, #0f5440 0%, rgba(15, 84, 64, 0) 70%),
    linear-gradient(118deg, #03170f 0%, #072d21 34%, #0f5a41 58%, #2a9b70 80%, #7fd9b1 100%);

  --raise: -9px -9px 20px var(--hi), 11px 13px 26px var(--lo);
  --raise-sm: -4px -4px 10px var(--hi), 5px 6px 13px var(--lo);
  --press: inset 5px 6px 12px var(--lo), inset -5px -5px 12px var(--hi);
  --press-sm: inset 2px 3px 6px var(--lo), inset -3px -3px 6px var(--hi);
  --raise-md: -6px -6px 14px var(--hi), 8px 9px 18px var(--lo);

  --r-module: 28px;
  --r-well: 20px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --font: "Geist", ui-sans-serif, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", monospace;
}

html[data-theme="dark"] {
  --clay: #101715;
  --clay-face: linear-gradient(150deg, #151e1b 0%, #0f1513 100%);
  --hi: rgba(160, 230, 200, 0.05);
  --lo: rgba(0, 0, 0, 0.55);
  --lo-strong: rgba(0, 0, 0, 0.7);
  --edge: rgba(190, 240, 215, 0.06);

  --ink: #e6efeb;
  --ink-2: #a8bab2;
  --ink-3: #8b9d95;
  --accent: #6fdcae;
  --accent-soft: #4cc595;

  --btn-bg: #8be6bf;
  --btn-ink: #052117;
  --line: rgba(190, 240, 215, 0.08);
  --tint: rgba(190, 240, 215, 0.035);
  --accent-tint: rgba(111, 220, 174, 0.12);

  --seg-a: #8be6bf;
  --seg-b: #2f9e74;
  --seg-c: #2a3632;
}

/* ── Base ─────────────────────────────────────────────────────────────── */

body.rf-site {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--clay);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  caret-color: var(--accent);
  scrollbar-color: var(--accent-soft) var(--clay);
}

.rf-site ::selection {
  background: #9fe8c6;
  color: #052117;
}

.rf-site a:focus-visible,
.rf-site button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 999px;
}

.rf-site .hidden {
  display: none;
}

.rf-wrap {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 24px;
  box-sizing: border-box;
}

.rf-num {
  font-family: var(--font);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

.rf-h2 {
  margin: 0 0 20px;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.03em;
  text-wrap: balance;
  color: var(--ink);
}

.rf-h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.rf-h3 .ph {
  font-size: 1.15rem;
  color: var(--accent);
}

.rf-body {
  margin: 0 0 24px;
  max-width: 52ch;
  color: var(--ink-2);
  font-size: 1.0625rem;
}

.rf-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

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

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

.rf-section {
  padding-block: clamp(64px, 9vw, 120px) 0;
}

/* Neumorphic primitives */

.rf-panel {
  background: var(--clay-face);
  border: 1px solid var(--edge);
  border-radius: var(--r-module);
  box-shadow: var(--raise);
}

.rf-well {
  background: var(--clay);
  border-radius: var(--r-module);
  box-shadow: var(--press);
}

/* ── Buttons ──────────────────────────────────────────────────────────── */

.rf-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 26px;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 220ms var(--ease-out), box-shadow 220ms var(--ease-out), background-color 220ms ease;
}

.rf-btn:active {
  transform: translateY(1px) scale(0.985);
}

.rf-btn--primary {
  /* Always sits on the green hero field, so it keeps one light fill in both themes. */
  background: #f4f9f6;
  color: #052117;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 14px 30px -12px rgba(1, 20, 13, 0.6);
}

.rf-btn--primary:hover {
  background: #ffffff;
}

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

.rf-btn--primary:hover .ph {
  transform: translateX(4px);
}

.rf-btn--soft {
  color: #eef8f3;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.rf-btn--soft:hover {
  background: rgba(255, 255, 255, 0.16);
}

/* ── Nav ──────────────────────────────────────────────────────────────── */

.rf-nav {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 20;
}

.rf-nav__inner {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.rf-nav__brand {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: #f1f7f4;
  text-decoration: none;
}

.rf-nav__right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rf-nav__links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.rf-nav__link {
  padding: 8px 14px;
  border-radius: 999px;
  color: rgba(236, 247, 241, 0.82);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 180ms ease, background-color 180ms ease;
}

.rf-nav__link:hover,
.rf-nav__link[aria-current="page"] {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.rf-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #eef8f3;
  font: 500 0.8125rem/1 var(--font);
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
  transition: background-color 180ms ease;
}

.rf-toggle:hover {
  background: rgba(255, 255, 255, 0.16);
}

.rf-toggle .ph {
  font-size: 1rem;
}

/* ── Footer ───────────────────────────────────────────────────────────── */

.rf-footer {
  background: var(--clay);
  padding: 72px 0 40px;
}

.rf-footer .rf-nav__brand {
  color: var(--ink);
}

.rf-footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(4, minmax(0, 1fr));
  gap: 40px;
  margin-bottom: 56px;
}

.rf-footer__brand p {
  margin: 12px 0 0;
  max-width: 32ch;
  color: var(--ink-3);
  font-size: 0.9375rem;
}

.rf-footer__head {
  margin: 0 0 14px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink);
}

.rf-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.rf-footer a {
  color: var(--ink-2);
  font-size: 0.9375rem;
  text-decoration: none;
  transition: color 160ms ease;
}

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

.rf-footer__base {
  display: flex;
  gap: 24px;
  padding-top: 24px;
  box-shadow: inset 0 1px 0 var(--lo), inset 0 2px 0 var(--hi);
}


/* ── Masthead (every page except home) ────────────────────────────────── */

.rf-mast {
  position: relative;
  isolation: isolate;
  padding: 76px 0 96px;
  color: #f1f8f4;
}

.rf-mast__field {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--field);
  background-size: 160% 160%;
  background-position: 0% 0%;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 96px), 0 100%);
}

.rf-mast__field::after {
  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-mast section[class],
.rf-mast section {
  background: transparent;
  border-color: transparent;
}

.rf-mast .pt-14 {
  padding-top: 40px;
}

.rf-mast .pb-12 {
  padding-bottom: 8px;
}

.rf-mast h1 {
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
  font-weight: 600;
  color: #f3f9f6;
  text-wrap: balance;
}

.rf-mast p,
.rf-mast .text-gray-500,
.rf-mast .text-gray-600 {
  color: rgba(226, 243, 235, 0.86);
}

.rf-mast .text-gray-400,
.rf-mast .text-gray-300 {
  color: rgba(214, 236, 226, 0.74);
}

.rf-mast .text-gray-900,
.rf-mast .text-gray-700 {
  color: #f3f9f6;
}

.rf-mast .uppercase {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.9375rem;
  font-weight: 500;
}

.rf-mast :is(div, aside, p).bg-gray-50,
.rf-mast :is(div, aside, p).bg-white {
  background: rgba(3, 25, 17, 0.3);
  border-color: rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.rf-mast a {
  color: #f3f9f6;
  text-decoration-color: rgba(166, 241, 204, 0.6);
}

.rf-mast > section:first-of-type .text-xs {
  font-size: 0.875rem;
}

/* Breadcrumb strip */
.rf-mast .py-2\.5 {
  padding-top: 20px;
  padding-bottom: 0;
}

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

  .rf-mast h1 {
    animation: rf-rise 900ms var(--ease-out) both;
  }
}

@keyframes rf-drift {
  from { background-position: 0% 0%; }
  to { background-position: 100% 60%; }
}

@keyframes rf-rise {
  from { opacity: 0; transform: translateY(18px); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: none; }
}

/* ── Content remap ────────────────────────────────────────────────────────
   Inner pages are authored with Tailwind utilities. This layer translates
   that vocabulary into the neumorphic world without touching the markup:
   bands become one clay surface, white cards become raised modules, grey
   insets become pressed wells, every accent collapses into the green family.
   ────────────────────────────────────────────────────────────────────────── */

.rf-content {
  padding-bottom: clamp(56px, 8vw, 104px);
}

.rf-content section[class],
.rf-content section {
  background: transparent;
  border-color: transparent;
}

.rf-content .border-gray-100,
.rf-content .border-gray-200,
.rf-content .border-gray-300,
.rf-content .divide-gray-100 > * + *,
.rf-content .divide-gray-200 > * + * {
  border-color: var(--line);
}

/* Raised modules */
.rf-content :is(div, a, aside, article, figure, details, li).bg-white {
  background: var(--clay-face);
  border-color: var(--edge);
  box-shadow: var(--raise-md);
}

.rf-content .bg-white .bg-white {
  background: transparent;
  box-shadow: none;
  border-color: var(--line);
}

.rf-content .shadow-sm {
  box-shadow: var(--raise-md);
}

.rf-content a.bg-white:hover,
.rf-content a.hover\:shadow-sm:hover,
.rf-content a.hover\:border-gray-300:hover {
  box-shadow: var(--raise-sm);
  border-color: var(--edge);
}

/* Pressed wells and tints */
.rf-content :is(div, aside, figure, details, li, a, p).bg-gray-50 {
  background: var(--clay);
  border-color: transparent;
  box-shadow: var(--press-sm);
}

.rf-content .bg-gray-50\/70,
.rf-content .bg-gray-50\/40,
.rf-content thead,
.rf-content thead tr,
.rf-content tr.bg-gray-50 {
  background: var(--tint);
  box-shadow: none;
}

.rf-content .hover\:bg-gray-50:hover,
.rf-content .hover\:bg-gray-50\/50:hover,
.rf-content .hover\:bg-gray-100:hover,
.rf-content .hover\:bg-white:hover {
  background: var(--tint);
}

.rf-content .bg-gray-100,
.rf-content .bg-slate-100,
.rf-content .bg-indigo-50,
.rf-content .bg-amber-50 {
  background: var(--clay);
  box-shadow: var(--press-sm);
}

.rf-content .bg-emerald-50,
.rf-content .bg-emerald-50\/40 {
  background: var(--accent-tint);
}

.rf-content .border-emerald-200 {
  border-color: rgba(47, 158, 116, 0.35);
}

/* Bars, tracks and fills */
.rf-content .bg-gray-200,
.rf-content .diagram-track {
  background: var(--clay);
  box-shadow: var(--press-sm);
}

.rf-content .bg-gray-900,
.rf-content .bg-slate-700,
.rf-content .diagram-fill-strong {
  background: var(--seg-a);
}

.rf-content .bg-slate-500,
.rf-content .diagram-fill-medium {
  background: var(--seg-b);
}

.rf-content .bg-slate-400,
.rf-content .diagram-fill-soft {
  background: #7cc9a6;
}

.rf-content .bg-slate-300,
.rf-content .diagram-fill-muted {
  background: var(--seg-c);
}

/* Buttons */
.rf-content a.bg-gray-900,
.rf-content button.bg-gray-900 {
  background: var(--btn-bg);
  color: var(--btn-ink);
  border-radius: 999px;
  padding-inline: 22px;
  box-shadow: 0 12px 24px -14px rgba(3, 30, 20, 0.6);
}

.rf-content a.bg-gray-900:hover,
.rf-content button.bg-gray-900:hover {
  filter: brightness(1.15);
}

.rf-content a.inline-flex.rounded-lg,
.rf-content button.rounded-lg {
  border-radius: 999px;
  padding-inline: 22px;
}

.rf-content a.inline-flex.rounded-lg.bg-white {
  box-shadow: var(--raise-sm);
}

.rf-content a.inline-flex.rounded-lg.bg-white:hover {
  box-shadow: var(--press-sm);
}

/* Shape system */
.rf-content .rounded-xl { border-radius: 24px; }
.rf-content .rounded-2xl { border-radius: var(--r-module); }
.rf-content .rounded-lg { border-radius: 16px; }
.rf-content span.rounded,
.rf-content span.rounded-md,
.rf-content span.rounded-full { border-radius: 999px; }

/* Type */
.rf-content h1,
.rf-content h2,
.rf-content h3 {
  color: var(--ink);
  text-wrap: balance;
}

.rf-content h2 {
  letter-spacing: -0.03em;
}

.rf-content .text-2xl,
.rf-content .text-3xl,
.rf-content .text-4xl {
  letter-spacing: -0.03em;
}

.rf-content .text-gray-900,
.rf-content .text-slate-700 {
  color: var(--ink);
}

.rf-content .text-gray-800,
.rf-content .text-gray-700,
.rf-content .text-gray-600,
.rf-content .text-gray-500 {
  color: var(--ink-2);
}

.rf-content .text-gray-400,
.rf-content .text-gray-300 {
  color: var(--ink-3);
}

.rf-content .text-white {
  color: var(--btn-ink);
}

.rf-content .text-emerald-700,
.rf-content .text-emerald-600,
.rf-content .text-emerald-400,
.rf-content .text-indigo-600,
.rf-content .text-indigo-700,
.rf-content .text-amber-700 {
  color: var(--accent);
}

.rf-content .hover\:text-gray-900:hover,
.rf-content .hover\:text-gray-800:hover,
.rf-content .hover\:text-gray-600:hover,
.rf-content .group:hover [class*="group-hover:text-"] {
  color: var(--accent);
}

/* Labels: the uppercase micro-label habit becomes quiet sentence case */
.rf-content .uppercase {
  text-transform: none;
  letter-spacing: -0.005em;
}

.rf-content p.uppercase,
.rf-content span.uppercase,
.rf-content h2.uppercase,
.rf-content h3.uppercase {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-2);
}

.rf-content th {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-3);
}

.rf-content td,
.rf-content .tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* Links */
.rf-content a.underline,
.rf-content p a,
.rf-content li a:not([class]) {
  text-decoration-line: underline;
  text-decoration-color: var(--accent-soft);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

.rf-content a.underline:hover {
  color: var(--accent);
  opacity: 1;
}

/* Forms */
.rf-content input:not([type="checkbox"]):not([type="radio"]),
.rf-content select,
.rf-content textarea {
  background: var(--clay);
  color: var(--ink);
  border-color: transparent;
  border-radius: 999px;
  box-shadow: var(--press-sm);
}

.rf-content textarea {
  border-radius: var(--r-well);
}

.rf-content input:focus,
.rf-content select:focus,
.rf-content textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  --tw-ring-shadow: 0 0 #0000;
}

.rf-content input::placeholder {
  color: var(--ink-3);
}

/* Tables: the scroll container is the raised module, rows sit flat inside */
.rf-content .overflow-x-auto.rounded-xl {
  background: var(--clay-face);
  border-color: var(--edge);
  box-shadow: var(--raise-md);
}

.rf-content :is(table, tbody, tr, td).bg-white {
  background: transparent;
  box-shadow: none;
}

.rf-content table {
  border-collapse: separate;
  border-spacing: 0;
}

.rf-content tbody tr {
  transition: background-color 160ms ease;
}

.rf-content code {
  font-family: var(--mono);
  font-size: 0.875em;
}

/* Details / summary */
.rf-content summary {
  cursor: pointer;
}

.rf-content summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 12px;
}

/* ── Shared responsive ────────────────────────────────────────────────── */

@media (max-width: 1024px) {
  .rf-footer__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rf-footer__brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 767px) {
  .rf-wrap {
    padding-inline: 16px;
  }

  .rf-nav__inner {
    height: 64px;
  }

  .rf-nav__link {
    padding: 8px 10px;
  }

  .rf-nav__link--home,
  .rf-toggle__label {
    display: none;
  }

  .rf-toggle {
    width: 38px;
    padding: 0;
    justify-content: center;
  }

  .rf-btn {
    height: 48px;
    padding: 0 22px;
  }

  .rf-footer__grid {
    gap: 32px;
  }

  .rf-mast {
    padding: 64px 0 72px;
  }

  .rf-mast__field {
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 48px), 0 100%);
  }

  .rf-site .px-6 {
    padding-left: 16px;
    padding-right: 16px;
  }
}
