/* ============================================================
   Rabbit River — shared design system
   One canonical stylesheet used by both sites.
   Tokens carried over from the existing Rabbit River tools.
   Site tone differences are handled with body classes:
     .site-company  — quieter, editorial, more air
     .site-systems  — more active, commercial, structured
   ============================================================ */

:root {
  /* Brand palette (from existing Rabbit River tools) */
  --teal: #20A9A4;
  --teal-dark: #17807C;
  --orange: #DF851F;
  --orange-soft: #FEA850;
  --cream: #F6F0E4;
  --paper: #FDFBF6;
  --card: #FFFFFF;
  --ink: #1F1F1F;
  --ink-soft: #5A5A55;
  --line: #E5DECF;
  --danger: #C0442E;

  /* Type */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Scale */
  --step--1: clamp(0.83rem, 0.8rem + 0.15vw, 0.9rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.08rem);
  --step-1: clamp(1.2rem, 1.1rem + 0.5vw, 1.4rem);
  --step-2: clamp(1.45rem, 1.25rem + 1vw, 1.9rem);
  --step-3: clamp(1.8rem, 1.45rem + 1.8vw, 2.6rem);
  --step-4: clamp(2.2rem, 1.7rem + 2.6vw, 3.4rem);

  /* Space + shape */
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(31, 31, 31, 0.08), 0 4px 14px rgba(31, 31, 31, 0.05);
  --shadow-lg: 0 2px 6px rgba(31, 31, 31, 0.08), 0 12px 34px rgba(31, 31, 31, 0.08);
  --wrap: 1080px;
  --wrap-narrow: 760px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--teal-dark); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--teal); }

h1, h2, h3, h4 { line-height: 1.15; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); }
p { max-width: 68ch; }

/* ---------- Layout helpers ---------- */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 24px; }
.narrow { max-width: var(--wrap-narrow); }
.section { padding-block: clamp(48px, 7vw, 96px); }
.section--tight { padding-block: clamp(32px, 5vw, 60px); }
.section--cream { background: var(--cream); }
.eyebrow {
  font-size: var(--step--1); font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--teal-dark); margin-bottom: 14px;
}
.lede { font-size: var(--step-1); color: var(--ink-soft); font-weight: 400; }
.stack > * + * { margin-top: 1rem; }
.center { text-align: center; }
.center p { margin-inline: auto; }

/* ---------- Skip link + focus ---------- */
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--radius-sm);
  transition: top 0.2s var(--ease);
}
.skip:focus { top: 12px; color: #fff; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; border-radius: 4px; }

/* ---------- Brand mark ---------- */
.mark {
  width: 40px; height: 40px; border-radius: 50%; background: var(--teal);
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.mark svg { width: 24px; height: 24px; }
.brandline { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brandline:hover { color: var(--ink); }
.brandname { font-weight: 800; letter-spacing: 0.02em; font-size: 15px; text-transform: uppercase; line-height: 1.1; }
.brandname span { color: var(--orange); }
.brandsub { display: block; font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--ink-soft); }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.1) blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 20px; min-height: 68px; }
.nav__links { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav__links a {
  color: var(--ink-soft); text-decoration: none; font-weight: 600; font-size: var(--step--1);
  padding: 8px 12px; border-radius: var(--radius-sm); transition: color 0.15s var(--ease), background 0.15s var(--ease);
}
.nav__links a:hover { color: var(--ink); background: var(--cream); }
.nav__links a[aria-current="page"] { color: var(--teal-dark); }
.nav__toggle {
  margin-left: auto; display: none; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--card); cursor: pointer; color: var(--ink);
}
.nav__toggle svg { width: 22px; height: 22px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-weight: 700; font-size: var(--step-0); line-height: 1;
  padding: 14px 22px; border-radius: var(--radius-sm); border: 1.5px solid transparent;
  cursor: pointer; text-decoration: none; transition: transform 0.12s var(--ease),
    background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--primary { background: var(--teal); color: #fff; }
.btn--primary:hover { background: var(--teal-dark); color: #fff; }
.btn--secondary { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--secondary:hover { border-color: var(--teal); color: var(--teal-dark); }
.btn--ghost { background: transparent; color: var(--teal-dark); padding-inline: 6px; }
.btn--ghost:hover { color: var(--teal); }
.btn--sm { padding: 9px 14px; font-size: var(--step--1); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(56px, 9vw, 120px); position: relative; overflow: hidden; }
.hero__inner { max-width: 780px; }
.hero h1 { margin-bottom: 20px; }
.hero .lede { margin-bottom: 28px; max-width: 56ch; }
.hero__flow { margin-top: 44px; }

/* River / flow line motif (understated, drawn) */
.flowline { width: 100%; height: auto; color: var(--line); }
.flowline .stroke-teal { color: var(--teal); }
.flowline .stroke-orange { color: var(--orange-soft); }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 20px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px; height: 100%;
}
.card h3 { font-size: var(--step-1); margin-bottom: 8px; }
.card p { color: var(--ink-soft); }
.card--link { transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease); text-decoration: none; color: inherit; display: block; }
.card--link:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); color: inherit; }

/* Icon chip */
.chip {
  width: 44px; height: 44px; border-radius: 10px; display: inline-flex;
  align-items: center; justify-content: center; margin-bottom: 16px;
  background: rgba(32, 169, 164, 0.12); color: var(--teal-dark);
}
.chip svg { width: 24px; height: 24px; }
.chip--orange { background: rgba(223, 133, 31, 0.14); color: var(--orange); }

/* ---------- Status badges (tools) ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em; padding: 4px 10px; border-radius: 20px;
  background: var(--line); color: var(--ink-soft); white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--pilot { background: rgba(32, 169, 164, 0.15); color: var(--teal-dark); }
.badge--custom { background: rgba(223, 133, 31, 0.15); color: var(--orange); }
.badge--dev { background: rgba(31, 31, 31, 0.08); color: var(--ink-soft); }

/* ---------- Problem list ---------- */
.problem-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 28px; list-style: none; }
.problem-list li { position: relative; padding-left: 26px; color: var(--ink); }
.problem-list li::before {
  content: ""; position: absolute; left: 0; top: 0.55em; width: 12px; height: 2px;
  background: var(--orange); border-radius: 2px;
}

/* ---------- Numbered process ---------- */
.steps { counter-reset: step; display: grid; gap: 14px; list-style: none; }
.steps li { position: relative; padding-left: 52px; min-height: 36px; display: flex; flex-direction: column; justify-content: center; }
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0; width: 36px; height: 36px; border-radius: 50%;
  background: var(--cream); border: 1.5px solid var(--line); color: var(--teal-dark);
  font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.steps--inline { grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.steps--inline li { padding-left: 0; padding-top: 48px; text-align: center; align-items: center; }
.steps--inline li::before { left: 50%; transform: translateX(-50%); }

/* ---------- Proof points ---------- */
.proof { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 28px; list-style: none; }
.proof li { padding-left: 28px; position: relative; color: var(--ink-soft); }
.proof li::before {
  content: ""; position: absolute; left: 0; top: 0.35em; width: 16px; height: 16px;
  background: var(--teal); -webkit-mask: var(--check) center/contain no-repeat; mask: var(--check) center/contain no-repeat;
}
:root { --check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E"); }

/* ---------- Founder ---------- */
.founder { display: grid; grid-template-columns: 220px 1fr; gap: 40px; align-items: start; }
.founder__photo {
  aspect-ratio: 4 / 5; border-radius: var(--radius); background: var(--cream);
  border: 1px solid var(--line); display: flex; align-items: center; justify-content: center;
  color: var(--ink-soft); overflow: hidden;
}
.founder__photo svg { width: 64px; height: 64px; opacity: 0.4; }

/* ---------- Callout / feature panel ---------- */
.panel {
  background: var(--ink); color: var(--paper); border-radius: var(--radius);
  padding: clamp(28px, 5vw, 52px);
}
.panel h2 { color: #fff; }
.panel .lede { color: rgba(253, 251, 246, 0.78); }
.panel a.btn--secondary { color: #fff; border-color: rgba(253, 251, 246, 0.4); }
.panel a.btn--secondary:hover { border-color: #fff; color: #fff; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 18px; max-width: 640px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: var(--step--1); }
.field .req { color: var(--danger); }
.field .hint { font-size: var(--step--1); color: var(--ink-soft); }
.input, .textarea, .select {
  font-family: inherit; font-size: var(--step-0); color: var(--ink);
  padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: var(--card); width: 100%; transition: border-color 0.15s var(--ease);
}
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(32, 169, 164, 0.18); }
.textarea { min-height: 130px; resize: vertical; }
.field--error .input, .field--error .textarea, .field--error .select { border-color: var(--danger); }
.error-text { color: var(--danger); font-size: var(--step--1); display: none; }
.field--error .error-text { display: block; }
.form__note { font-size: var(--step--1); color: var(--ink-soft); }
.form-success {
  display: none; background: rgba(32, 169, 164, 0.1); border: 1px solid var(--teal);
  border-radius: var(--radius); padding: 24px; color: var(--teal-dark);
}
.form-success.is-visible { display: block; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Footer ---------- */
.site-footer { margin-top: auto; background: var(--cream); border-top: 1px solid var(--line); padding-block: 48px 32px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; margin-bottom: 32px; }
.footer-grid h4 { font-size: var(--step--1); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); margin-bottom: 12px; }
.footer-grid ul { list-style: none; display: grid; gap: 8px; }
.footer-grid a { color: var(--ink); text-decoration: none; font-size: var(--step--1); }
.footer-grid a:hover { color: var(--teal-dark); }
.footer-tag { color: var(--ink-soft); font-size: var(--step--1); max-width: 40ch; margin-top: 12px; }
.footer-bottom { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between;
  align-items: center; border-top: 1px solid var(--line); padding-top: 20px; font-size: var(--step--1); color: var(--ink-soft); }
.footer-bottom a { color: var(--ink-soft); }

/* ---------- Prose (About / legal) ---------- */
.prose { max-width: var(--wrap-narrow); }
.prose h2 { font-size: var(--step-2); margin-top: 2.2em; margin-bottom: 0.5em; }
.prose h3 { margin-top: 1.6em; margin-bottom: 0.4em; }
.prose p, .prose ul, .prose ol { margin-bottom: 1em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: 0.4em; }
.prose .lede { margin-bottom: 1.4em; }

/* ---------- Utility ---------- */
.muted { color: var(--ink-soft); }
.divider { border: 0; border-top: 1px solid var(--line); margin-block: 0; }
.tag-quiet { font-size: var(--step--1); color: var(--ink-soft); }

/* ---------- Company-site tone (quieter, more editorial) ---------- */
.site-company { background: var(--paper); }
.site-company .hero { padding-block: clamp(72px, 11vw, 150px); }
.site-company h1, .site-company h2 { letter-spacing: -0.02em; }
.site-company .lede { max-width: 60ch; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .nav__links {
    position: fixed; inset: 68px 0 auto 0; flex-direction: column; align-items: stretch;
    gap: 0; background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 8px 16px 20px; margin-left: 0; box-shadow: var(--shadow-lg);
    display: none;
  }
  .nav__links.is-open { display: flex; }
  .nav__links a { padding: 14px 8px; border-radius: 0; border-bottom: 1px solid var(--line); font-size: var(--step-0); }
  .nav__links .btn { margin-top: 12px; }
  .nav__toggle { display: inline-flex; }
  .founder { grid-template-columns: 1fr; gap: 24px; }
  .founder__photo { max-width: 220px; }
}
@media (max-width: 720px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .problem-list, .proof { grid-template-columns: 1fr; }
  .steps--inline { grid-auto-flow: row; grid-auto-columns: auto; }
  .steps--inline li { padding-top: 0; padding-left: 52px; text-align: left; align-items: flex-start; }
  .steps--inline li::before { left: 0; transform: none; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  .btn:hover, .card--link:hover { transform: none; }
}

/* Gentle fade-in for sections (respects reduced-motion above) */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
