/* Rumona — design system
   Aligned with the product UI: indigo brand, white surfaces on a cool
   tinted ground, amber "à répondre", green "connecté", red "perdu". */

:root {
  --bg: #F6F7FB;
  --surface: #FFFFFF;
  --surface-2: #F1F2F8;
  --ink: #111427;
  --ink-2: #414766;
  --ink-3: #5F6584;
  --line: #E3E5EF;
  --line-2: #D5D8E6;

  --indigo: #4F46E5;
  --indigo-600: #4338CA;
  --indigo-700: #3730A3;
  --indigo-900: #1E1B4B;
  --indigo-50: #EEF0FF;
  --indigo-100: #E0E3FF;
  --indigo-200: #C7CBFE;

  --amber: #B45309;
  --amber-bg: #FEF3C7;
  --amber-line: #FCD9A0;
  --red: #DC2626;
  --red-bg: #FEE2E2;
  --green: #15803D;
  --green-bg: #DCFCE7;

  --font-display: "Bricolage Grotesque", "Plus Jakarta Sans", sans-serif;
  --font-body: "Plus Jakarta Sans", system-ui, sans-serif;

  --max-width: 1200px;
  --gutter: 24px;
  --radius: 14px;
  --radius-lg: 20px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);

  --shadow-sm: 0 1px 2px rgba(17, 20, 39, .05), 0 2px 6px rgba(17, 20, 39, .04);
  --shadow-lg: 0 2px 4px rgba(30, 27, 75, .04), 0 24px 48px -12px rgba(30, 27, 75, .18), 0 48px 96px -24px rgba(79, 70, 229, .16);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--indigo-200); color: var(--indigo-900); }

img, svg { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.1; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

h1, h2 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

h3 { font-weight: 700; letter-spacing: -0.01em; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--indigo);
  outline-offset: 3px;
  border-radius: 8px;
}

/* ---------- Brand ---------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--indigo);
  color: #fff;
  display: inline-grid;
  place-items: center;
  flex: none;
}
.brand-mark svg { width: 100%; height: 100%; }
.brand-mark.sm { width: 24px; height: 24px; border-radius: 7px; }
.brand-mark.xs { width: 20px; height: 20px; border-radius: 6px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 12px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.97rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color .2s, border-color .2s, color .2s, transform .2s var(--ease-out), box-shadow .2s;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--indigo);
  color: #fff;
  box-shadow: 0 1px 2px rgba(30, 27, 75, .2), 0 6px 16px -6px rgba(79, 70, 229, .55);
}
.btn-primary:hover { background: var(--indigo-600); }

.btn-ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-2);
}
.btn-ghost:hover { border-color: var(--ink-3); }

.btn-light {
  background: #fff;
  color: var(--indigo-700);
}
.btn-light:hover { background: var(--indigo-50); }

.btn-sm { min-height: 40px; padding: 0 16px; font-size: 0.9rem; border-radius: 10px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(246, 247, 251, .82);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 72px;
}

.site-nav { display: flex; gap: 32px; }
.site-nav a {
  font-size: 0.93rem;
  font-weight: 600;
  color: var(--ink-2);
  text-decoration: none;
  transition: color .2s;
}
.site-nav a:hover { color: var(--indigo); }

.header-link-return {
  color: var(--ink-2);
  font-weight: 600;
  font-size: 0.93rem;
  text-decoration: none;
}
.header-link-return:hover { color: var(--indigo); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 72px 0 96px;
  isolation: isolate;
}
.hero::before {
  /* dot grid, faded toward edges */
  content: "";
  position: absolute;
  inset: 0 0 30% 0;
  z-index: -1;
  background-image: radial-gradient(var(--line-2) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 50% 0%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 80% at 50% 0%, #000 30%, transparent 75%);
}

.hero-copy {
  max-width: 1040px;
  margin: 0 auto;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2.4rem, 5.6vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
}
.hero h1 .accent { display: block; color: var(--indigo); }
@media (max-width: 1080px) { .br-desktop { display: none; } }

.hero-subtitle {
  margin: 28px auto 0;
  max-width: 48ch;
  color: var(--ink-2);
  font-size: 1.12rem;
  line-height: 1.65;
}
.hero-subtitle strong { color: var(--ink); font-weight: 700; }

.hero-cta {
  margin-top: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-cta-note { margin-top: 14px; font-size: 0.88rem; color: var(--ink-3); }

/* ---------- App mock (shared) ---------- */
.app-stage { margin-top: 72px; }

.app {
  --app-radius: 18px;
  display: grid;
  grid-template-columns: 200px 1fr;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--app-radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  font-size: 13px;
  line-height: 1.45;
  text-align: left;
  height: 600px;
}

.app svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.app .brand-mark svg { stroke: none; }

.app-side {
  border-right: 1px solid var(--line);
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.app-logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 14px; padding: 0 8px; }
.app-nav { display: flex; flex-direction: column; gap: 2px; }
.app-nav li {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  color: var(--ink-2); font-weight: 600;
}
.app-nav li svg { width: 16px; height: 16px; flex: none; }
.app-nav li.is-active { background: var(--indigo-50); color: var(--indigo); box-shadow: inset 3px 0 0 var(--indigo); }

.app-main { display: flex; flex-direction: column; min-width: 0; background: var(--bg); }

.app-banner {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px;
  background: linear-gradient(90deg, #EEF0FF, #F6F4FF);
  border-bottom: 1px solid var(--indigo-100);
  transition: background .6s;
}
.app-banner-icon {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  display: grid; place-items: center;
  background: #fff; color: var(--indigo); border: 1px solid var(--indigo-100);
}
.app-banner-icon svg { width: 16px; height: 16px; }
.app[data-state="scanning"] .app-banner-icon svg { animation: spin 1.4s linear infinite; }
.app-banner-text { display: flex; flex-direction: column; min-width: 0; }
.app-banner-text strong { font-weight: 800; font-size: 13px; }
.app-banner-text span { font-size: 11.5px; color: var(--ink-3); }
.app-replay {
  margin-left: auto;
  font: inherit; font-size: 12px; font-weight: 700;
  color: var(--indigo); background: #fff;
  border: 1px solid var(--indigo-100); border-radius: 8px;
  padding: 6px 12px; cursor: pointer;
  opacity: 0; pointer-events: none;
  transition: opacity .4s;
}
.app[data-state="after"] .app-replay { opacity: 1; pointer-events: auto; }

.when-after { display: none; }
.app[data-state="after"] .when-after { display: revert; }
.app[data-state="after"] .when-before { display: none; }

.app-cols {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(260px, 330px) 1fr;
  gap: 14px;
  padding: 14px;
  min-height: 0;
}

/* inbox */
.inbox {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  display: flex; flex-direction: column;
}
.inbox-head { display: flex; align-items: baseline; justify-content: space-between; padding: 14px 16px 8px; }
.inbox-head strong { font-size: 16px; font-weight: 800; }
.inbox-head span { font-size: 11px; color: var(--ink-3); }
.inbox-tabs { display: flex; gap: 16px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.inbox-tabs span { padding: 8px 0 10px; font-weight: 700; color: var(--ink-3); font-size: 12.5px; }
.inbox-tabs span.is-active { color: var(--ink); box-shadow: inset 0 -2px 0 var(--indigo); }
.inbox-tabs em { font-style: normal; font-size: 10.5px; color: var(--indigo); margin-left: 2px; }

.inbox-list { position: relative; flex: 1; overflow: hidden; }

.conv {
  display: flex; gap: 11px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  transition: background-color .5s, opacity .5s;
}
.conv-body { min-width: 0; flex: 1; }
.conv-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.conv-top b { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-top time { font-size: 11px; color: var(--ink-3); flex: none; }
.conv p { color: var(--ink-2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }

.av {
  --h: 245;
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 800; letter-spacing: .02em;
  color: hsl(var(--h) 55% 32%);
  background: hsl(var(--h) 80% 92%);
  box-shadow: inset 0 0 0 1px hsl(var(--h) 60% 84%);
}
.av-square { border-radius: 10px; width: 40px; height: 40px; background: #3F3D5C; color: #fff; box-shadow: none; font-size: 15px; }

.tag {
  display: inline-flex; align-items: center;
  margin-top: 5px;
  font-size: 10.5px; font-weight: 700;
  padding: 2px 8px; border-radius: 6px;
  white-space: nowrap;
}
.tag-muted { color: var(--ink-3); background: var(--surface-2); }
.tag-amber { color: var(--amber); background: var(--amber-bg); }
.tag-indigo { color: var(--indigo); background: var(--indigo-50); }

/* tags hidden until analysis */
.app .conv .tag { opacity: 0; transform: translateY(4px); transition: opacity .4s, transform .4s var(--ease-out); }
.app[data-state="after"] .conv .tag { opacity: 1; transform: none; }
.app[data-state="after"] .conv:not(.is-hot) { opacity: .5; }
.app[data-state="before"] .conv.is-selected-before,
.app[data-state="scanning"] .conv.is-selected-before,
.app[data-state="after"] .conv.is-selected-after { background: var(--indigo-50); box-shadow: inset 3px 0 0 var(--indigo); }

.scan-line {
  position: absolute; left: 0; right: 0; top: 96px; height: 70px;
  background: linear-gradient(180deg, transparent, rgba(79, 70, 229, .12) 70%, rgba(79, 70, 229, .5) 100%);
  border-bottom: 1px solid var(--indigo);
  opacity: 0; pointer-events: none; z-index: 2;
  transform: translateY(-70px);
}
.app[data-state="scanning"] .scan-line { animation: scan 1.6s var(--ease-out) forwards; }

@keyframes scan {
  0% { opacity: 0; transform: translateY(-70px); }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { opacity: 0; transform: translateY(420px); }
}
@keyframes spin { to { transform: rotate(360deg); } }

/* thread */
.thread {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  display: flex; flex-direction: column;
  min-width: 0;
}
.thread-view { flex-direction: column; height: 100%; }
.app:not([data-state="after"]) .thread-view.when-before { display: flex; }
.app[data-state="after"] .thread-view.when-after { display: flex; animation: fadeUp .6s var(--ease-out); }
.thread-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.thread-head b { display: block; font-weight: 800; font-size: 14px; }
.thread-head small { display: flex; align-items: center; gap: 6px; color: var(--indigo); font-weight: 600; font-size: 11.5px; }
.dot { width: 7px; height: 7px; border-radius: 2px; background: var(--indigo); display: inline-block; }
.dot-green { background: #22C55E; border-radius: 50%; }
.pill-amber {
  margin-left: auto;
  font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  color: var(--amber); background: var(--amber-bg);
  padding: 4px 10px; border-radius: 999px;
}
.thread-msgs { flex: 1; padding: 6px 18px 12px; display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
.day { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 10.5px; font-weight: 700; margin: 6px 0 0; }
.day::before, .day::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.day-alert { color: var(--red); }
.day-alert::before, .day-alert::after { background: var(--red-bg); }

.bubble { max-width: 82%; padding: 10px 14px 8px; border-radius: 14px; font-size: 12.5px; }
.bubble time { display: block; text-align: right; font-size: 10px; margin-top: 4px; opacity: .75; }
.bubble.out { align-self: flex-end; background: var(--indigo); color: #fff; border-bottom-right-radius: 4px; }
.bubble.in { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }

.insight {
  font-size: 12px; color: var(--ink-2);
  background: var(--indigo-50);
  border: 1px solid var(--indigo-100);
  border-radius: 12px;
  padding: 10px 14px;
}
.insight b { display: block; color: var(--indigo-700); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 2px; }

.composer {
  display: flex; align-items: center; gap: 12px;
  margin: 0 14px 14px;
  padding: 10px 10px 10px 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  min-height: 56px;
}
.typed { flex: 1; font-size: 12.5px; color: var(--ink); min-height: 1.4em; }
.typed::after { content: ""; display: inline-block; width: 1.5px; height: 1.1em; background: var(--indigo); vertical-align: text-bottom; margin-left: 1px; animation: blink 1s steps(1) infinite; }
.send { width: 36px; height: 36px; border-radius: 50%; background: var(--indigo); color: #fff; display: grid; place-items: center; flex: none; }
.send svg { width: 16px; height: 16px; }

@keyframes blink { 50% { opacity: 0; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.mock-note { margin-top: 14px; text-align: center; font-size: 12px; color: var(--ink-3); }
.mock-note.left { text-align: left; }

/* ---------- Sections ---------- */
.section { padding: 120px 0; }

.section-head { max-width: 760px; }
.section-head h2, .today-copy h2 {
  font-size: clamp(2rem, 4vw, 3.1rem);
}
.lead {
  margin-top: 20px;
  color: var(--ink-2);
  font-size: 1.1rem;
  max-width: 62ch;
}

/* ---------- Leak (scrollytelling) ---------- */
.leak {
  padding: 120px 0 128px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.leak-grid {
  margin-top: 72px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}

.leak-visual {
  position: sticky;
  top: calc(50vh - 200px);
}

.leak-card {
  --temp: 92%;
  --temp-color: #F97316;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 22px;
  transition: filter .8s var(--ease-out), opacity .8s, transform .8s var(--ease-out);
}
.leak-card[data-stage="2"] { --temp: 66%; --temp-color: #F59E0B; }
.leak-card[data-stage="3"] { --temp: 30%; --temp-color: #818CF8; }
.leak-card[data-stage="4"] { --temp: 4%; --temp-color: #94A3B8; filter: grayscale(1); opacity: .72; transform: translateY(12px) scale(.98); }

.leak-row { display: flex; gap: 12px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.leak-row .conv-top b { font-size: 15px; }
.leak-row .conv-top time { font-size: 12px; font-weight: 600; }
.leak-row p { margin-top: 4px; color: var(--ink-2); font-size: 14px; }
.leak-row .av { width: 44px; height: 44px; font-size: 13px; }

.leak-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 18px 0 14px; }
.metric-label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.metric-value {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.6rem;
  letter-spacing: -0.03em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.metric-value sup { font-size: .45em; margin-left: 2px; vertical-align: super; }
#leak-temp-label { color: var(--temp-color); transition: color .6s; }

.thermo { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.thermo-fill {
  display: block; height: 100%;
  width: var(--temp);
  background: var(--temp-color);
  border-radius: inherit;
  transition: width 1s var(--ease-out), background-color .6s;
}

.leak-track { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.leak-track-label { font-size: 11px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.track { position: relative; flex: 1; height: 2px; background: repeating-linear-gradient(90deg, var(--line-2) 0 6px, transparent 6px 10px); }
.track-dot {
  position: absolute; top: 50%; left: 0;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--temp-color);
  box-shadow: 0 0 0 4px #fff, 0 2px 8px rgba(17, 20, 39, .2);
  transform: translate(-50%, -50%);
  transition: left 1s var(--ease-out), background-color .6s;
}
.leak-card[data-stage="2"] .track-dot { left: 22%; }
.leak-card[data-stage="3"] .track-dot { left: 72%; }
.leak-card[data-stage="4"] .track-dot { left: 100%; }

.leak-status {
  margin-top: 18px;
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  padding: 6px 12px; border-radius: 999px;
  color: var(--indigo); background: var(--indigo-50);
  transition: color .4s, background-color .4s;
}
.leak-card[data-stage="2"] .leak-status { color: var(--amber); background: var(--amber-bg); }
.leak-card[data-stage="3"] .leak-status { color: var(--ink-2); background: var(--surface-2); }
.leak-card[data-stage="4"] .leak-status { color: var(--red); background: var(--red-bg); }

.leak-steps { display: flex; flex-direction: column; }
.leak-step {
  min-height: 52vh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 24px 0;
  opacity: .28;
  transition: opacity .5s;
}
.leak-step:first-child { min-height: 40vh; }
.leak-step.is-active { opacity: 1; }
.leak-day {
  font-size: 0.85rem; font-weight: 800; color: var(--indigo);
  font-variant-numeric: tabular-nums;
}
.leak-step[data-stage="4"] .leak-day { color: var(--red); }
.leak-step h3 {
  margin-top: 10px;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.leak-step p { margin-top: 14px; color: var(--ink-2); font-size: 1.05rem; max-width: 46ch; }

.leak-close {
  margin: 96px auto 0;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 3.2vw, 2.4rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: var(--ink-3);
}
.leak-close strong { color: var(--ink); font-weight: 800; }

/* ---------- Positioning (indigo field) ---------- */
.position {
  position: relative;
  padding: 136px 0 128px;
  background: var(--indigo);
  color: #fff;
  overflow: hidden;
  isolation: isolate;
}
.position::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000, transparent 80%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000, transparent 80%);
}

.position blockquote {
  margin: 0 auto;
  max-width: 22ch;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 4.6vw, 3.8rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  color: rgba(255, 255, 255, .7);
  text-wrap: balance;
}
.position blockquote span { color: #fff; }

.pipeline {
  margin-top: 88px;
  display: grid;
  grid-template-columns: 1fr 1.25fr 1fr;
  align-items: stretch;
  gap: 0;
  position: relative;
}
.pipeline::before {
  /* the pipe running through all stages */
  content: "";
  position: absolute; left: 0; right: 0; top: 50%;
  height: 2px;
  background: rgba(255, 255, 255, .22);
  z-index: 0;
}

.pipe-stage {
  position: relative;
  z-index: 1;
  display: flex; flex-direction: column;
  padding: 28px;
  margin: 24px 0;
  border: 1px solid rgba(255, 255, 255, .22);
  background: var(--indigo);
  border-radius: var(--radius-lg);
  color: rgba(255, 255, 255, .86);
}
.pipe-stage:first-child { border-right: none; border-radius: var(--radius-lg) 0 0 var(--radius-lg); }
.pipe-stage:last-child { border-left: none; border-radius: 0 var(--radius-lg) var(--radius-lg) 0; }

.pipe-stage.is-rumona {
  margin: 0;
  padding: 36px 32px;
  background: #fff;
  color: var(--ink-2);
  border-color: #fff;
  box-shadow: 0 30px 60px -20px rgba(15, 12, 60, .55);
}
.pipe-num { font-size: 0.8rem; font-weight: 800; color: rgba(255, 255, 255, .6); font-variant-numeric: tabular-nums; }
.is-rumona .pipe-num { color: var(--indigo); }
.pipe-stage h3 {
  margin-top: 10px;
  font-family: var(--font-display);
  font-size: 1.45rem;
  line-height: 1.15;
  color: #fff;
}
.is-rumona h3 { color: var(--ink); font-size: 1.7rem; }
.pipe-stage p { margin-top: 12px; font-size: 0.97rem; }
.pipe-foot {
  margin-top: auto;
  padding-top: 24px;
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.82rem; font-weight: 700; color: rgba(255, 255, 255, .72);
}
.is-rumona .pipe-foot { color: var(--indigo); }

/* leaking drops under the conversion stage */
.drips {
  position: absolute; left: 0; right: 0; bottom: -64px; height: 64px;
  display: flex; justify-content: center; gap: 44px;
  pointer-events: none;
}
.drips i {
  width: 8px; height: 12px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: rgba(255, 255, 255, .7);
  opacity: 0;
  animation: drip 2.6s cubic-bezier(.55, 0, 1, .45) infinite;
}
.drips i:nth-child(2) { animation-delay: .9s; }
.drips i:nth-child(3) { animation-delay: 1.7s; }
@keyframes drip {
  0% { opacity: 0; transform: translateY(-10px) scale(.6); }
  15% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(56px) scale(.8); }
}

.position-note strong { color: #fff; font-weight: 700; }
.position-note {
  margin: 96px auto 0;
  max-width: 54ch;
  text-align: center;
  font-size: 1.12rem;
  color: rgba(255, 255, 255, .86);
}

/* ---------- Compare ---------- */
.compare-table {
  margin-top: 56px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.compare-row {
  display: grid;
  grid-template-columns: 180px 1fr 1fr;
  border-top: 1px solid var(--line);
}
.compare-row > * { padding: 20px 28px; }
.compare-labels { border-top: none; background: var(--surface-2); }
.compare-labels > span { padding-top: 16px; padding-bottom: 16px; font-size: 0.8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.lbl-before { color: var(--ink-3); }
.lbl-after { color: var(--indigo); }
.compare-topic { font-weight: 800; font-size: 0.95rem; }
.c-before { color: var(--ink-3); position: relative; padding-left: 52px; }
.c-after { color: var(--ink); font-weight: 700; position: relative; padding-left: 52px; background: linear-gradient(90deg, var(--indigo-50), transparent 70%); }
.c-before::before, .c-after::before {
  content: "";
  position: absolute; left: 24px; top: 24px;
  width: 16px; height: 16px; border-radius: 50%;
  background-repeat: no-repeat; background-position: center; background-size: 10px;
}
.c-before::before {
  background-color: var(--red-bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23DC2626' stroke-width='3.5' stroke-linecap='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E");
}
.c-after::before {
  background-color: var(--indigo);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}

/* ---------- Method ---------- */
.method { padding-top: 40px; }
.steps {
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  counter-reset: step;
}
.step { display: flex; flex-direction: column; }
.mini {
  height: 148px;
  display: grid; place-items: center;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  font-size: 13px;
  margin-bottom: 24px;
}
.step-num {
  font-size: 0.8rem; font-weight: 800; color: var(--indigo);
  font-variant-numeric: tabular-nums;
}
.step h3 { margin-top: 6px; font-size: 1.15rem; }
.step p { margin-top: 8px; color: var(--ink-2); font-size: 0.96rem; }

.mini-account { display: flex; align-items: center; gap: 12px; }
.mini-account b { display: block; font-weight: 800; font-size: 14px; }
.pill-green {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 4px;
  padding: 2px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
  color: var(--green); background: var(--green-bg);
  box-shadow: inset 0 0 0 1px #BBF7D0;
}

.mini-scan { width: 100%; text-align: center; }
.mini-scan b { font-weight: 800; font-size: 13px; }
.mini-scan small { display: block; margin-top: 8px; color: var(--ink-3); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.bar { margin-top: 12px; height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar span { display: block; height: 100%; width: 100%; background: var(--indigo); border-radius: inherit; transform-origin: left; }
.step.is-in .bar span { animation: fill 2.2s var(--ease-out) both; }
@keyframes fill { from { transform: scaleX(0); } }

.mini-tabs { display: flex; gap: 14px; font-weight: 700; font-size: 12.5px; color: var(--ink-3); border-bottom: 1px solid var(--line); }
.mini-tabs span { padding: 6px 0 8px; white-space: nowrap; }
.mini-tabs .is-active { color: var(--ink); box-shadow: inset 0 -2px 0 var(--indigo); }
.mini-tabs em { font-style: normal; font-size: 10.5px; color: var(--indigo); }

.mini-msg { width: 100%; }
.mini-msg .tag { margin: 0 0 8px; }
.mini-msg p {
  padding: 10px 12px;
  border-radius: 12px 12px 12px 4px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 12.5px;
}

/* ---------- Calculator ---------- */
.section.calc { padding: 88px 0; }
.calc-title { text-align: center; font-size: clamp(1.9rem, 3.4vw, 2.6rem); }
.calc-card {
  margin-top: 40px;
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.calc-inputs {
  padding: 40px;
  display: grid;
  gap: 26px;
  align-content: start;
  border-right: 1px solid var(--line);
}
.calc-results { padding: 40px; display: grid; gap: 28px; align-content: start; }

.calc-field { display: grid; gap: 8px; }
.calc-label {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-3);
}
.calc-hint { font-size: 0.82rem; color: var(--ink-3); }

.calc-field input {
  width: 100%;
  min-height: 50px;
  padding: 0 16px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--surface);
  font: 600 1.05rem var(--font-body);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  transition: border-color .2s, box-shadow .2s;
  -moz-appearance: textfield;
}
.calc-field input::-webkit-outer-spin-button,
.calc-field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.calc-field input:hover { border-color: var(--ink-3); }
.calc-field input:focus { outline: none; border-color: var(--indigo); box-shadow: 0 0 0 3px var(--indigo-100); }

.calc-suffix { position: relative; display: block; }
.calc-suffix input { padding-right: 40px; }
.calc-suffix::after {
  content: attr(data-suffix);
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 600;
  color: var(--ink-3);
  pointer-events: none;
}

.calc-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}
.calc-kpis .calc-label { display: block; }
.calc-num {
  display: block;
  margin-top: 8px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.calc-num.is-loss { color: var(--red); }

.calc-bars { display: grid; gap: 18px; }
.calc-bar-top { display: flex; justify-content: space-between; gap: 12px; font-size: 0.92rem; color: var(--ink-2); }
.calc-bar-top b { color: var(--ink); font-variant-numeric: tabular-nums; }
.calc-bar { margin-top: 8px; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.calc-bar span { display: block; height: 100%; border-radius: inherit; background: var(--indigo); transition: width .6s var(--ease-out); }
.calc-bar-row.is-loss .calc-bar span { background: var(--red); }
.calc-bar-row.is-loss .calc-bar-top b { color: var(--red); }

.calc-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.calc-cta-title { font-weight: 700; }
.calc-cta-sub { margin-top: 4px; font-size: 0.88rem; color: var(--ink-3); max-width: 38ch; }
.calc-cta .btn { flex: none; }

.calc-sources { margin: 16px auto 0; font-size: 0.8rem; color: var(--ink-3); max-width: 90ch; text-align: center; }
.calc-sources strong { color: var(--ink-2); }

/* ---------- Today ---------- */
.today { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.today-grid {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 80px;
  align-items: center;
}

.stats {
  margin-top: 44px;
  display: grid;
  grid-template-columns: repeat(3, auto);
  justify-content: start;
  gap: 0;
}
.stats > div { padding: 0 28px; border-left: 1px solid var(--line); }
.stats > div:first-child { padding-left: 0; border-left: none; }
.stat-num {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.6rem;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat-label { display: block; margin-top: 8px; font-size: 0.85rem; color: var(--ink-3); }
.today-copy .mock-note { margin-top: 20px; }

.daily {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 14px;
  font-size: 13px;
}
.daily-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 16px; }
.daily-head b { display: block; font-weight: 800; font-size: 16px; }
.daily-head small { color: var(--ink-3); font-size: 12px; }
.pill-count {
  min-width: 28px; height: 28px; padding: 0 8px;
  display: grid; place-items: center;
  border-radius: 999px;
  background: var(--indigo); color: #fff;
  font-weight: 800; font-size: 13px;
}
.daily-list { display: flex; flex-direction: column; gap: 10px; }
.daily-list li {
  display: flex; gap: 12px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.daily-list .conv-top { align-items: center; }
.daily-list .conv-top b { font-size: 14px; }
.daily-list .tag { margin: 0; }
.why { margin-top: 3px; font-weight: 600; color: var(--ink); font-size: 12.5px; }
.draft {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--indigo-50);
  color: var(--indigo-900);
  font-size: 12.5px;
}

/* ---------- CTA ---------- */
.cta-final { padding: 0 0 120px; }
.cta-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: 88px 64px;
  border-radius: 28px;
  background: var(--indigo-900);
  color: #fff;
  text-align: center;
}
.cta-card::before {
  content: "";
  position: absolute; inset: auto -10% -60% -10%; height: 120%;
  z-index: -1;
  background: radial-gradient(ellipse at center, rgba(99, 102, 241, .55), transparent 65%);
}
.cta-card h2 {
  font-size: clamp(2rem, 4.4vw, 3.4rem);
  max-width: 18ch;
  margin: 0 auto;
}
.cta-card p { margin: 20px auto 0; max-width: 56ch; color: rgba(255, 255, 255, .8); font-size: 1.08rem; }
.cta-note { color: rgba(255, 255, 255, .7); font-size: 0.9rem; }

/* ---------- Footer ---------- */
.site-footer { padding: 40px 0 48px; border-top: 1px solid var(--line); }
.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px 32px;
}
.brand-sm { font-size: 1rem; }
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-links a { color: var(--ink-2); text-decoration: none; font-size: 0.9rem; font-weight: 500; }
.footer-links a:hover { color: var(--indigo); }
.footer-copy { color: var(--ink-3); font-size: 0.85rem; }

/* ---------- Legal pages ---------- */
.legal-page { padding: 72px 0 112px; }
.legal-page h1 { font-size: clamp(2rem, 4vw, 3rem); max-width: 24ch; }
.legal-updated { margin-top: 14px; color: var(--ink-3); font-size: 0.9rem; }
.legal-body {
  margin-top: 48px;
  max-width: 72ch;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 48px;
}
.legal-body h2 { font-size: 1.35rem; letter-spacing: -0.02em; margin-top: 44px; margin-bottom: 14px; }
.legal-body h2:first-child { margin-top: 0; }
.legal-body p { color: var(--ink-2); margin-bottom: 14px; }
.legal-body strong { color: var(--ink); }
.legal-body ul { margin-bottom: 14px; }
.legal-body li { color: var(--ink-2); padding-left: 20px; position: relative; margin-bottom: 8px; }
.legal-body li::before { content: ""; position: absolute; left: 2px; top: .7em; width: 6px; height: 6px; border-radius: 2px; background: var(--indigo); }
.legal-body a { color: var(--indigo); font-weight: 600; }
.placeholder { color: var(--amber); background: var(--amber-bg); padding: 0 4px; border-radius: 4px; font-style: italic; }

/* ---------- Contact ---------- */
.contact-page { padding: 88px 0 128px; }
.contact-page h1 { font-size: clamp(2.2rem, 4.4vw, 3.4rem); }
.contact-intro { margin-top: 16px; color: var(--ink-2); font-size: 1.08rem; max-width: 52ch; }
.contact-methods {
  margin-top: 44px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 320px));
  gap: 16px;
}
.contact-method {
  display: block;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition: border-color .2s, transform .3s var(--ease-out), box-shadow .3s;
}
.contact-method:hover { border-color: var(--indigo-200); transform: translateY(-2px); box-shadow: 0 12px 28px -12px rgba(79, 70, 229, .3); }
.contact-method-label { display: block; color: var(--ink-3); font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; }
.contact-method-value { font-weight: 800; font-size: 1.1rem; color: var(--ink); }

/* ---------- 404 ---------- */
.error-page { padding: 140px 0; }
.error-page h1 { font-size: clamp(2.2rem, 4.4vw, 3.4rem); }
.error-page p { margin-top: 16px; color: var(--ink-2); max-width: 50ch; font-size: 1.08rem; }
.error-page .btn { margin-top: 32px; }

/* ---------- Reveal on scroll (progressive enhancement) ---------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  filter: blur(6px);
  transition: opacity .9s var(--ease-out), transform .9s var(--ease-out), filter .9s var(--ease-out);
  transition-delay: var(--delay, 0s);
}
.js [data-reveal].is-in { opacity: 1; transform: none; filter: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .app { grid-template-columns: 1fr; }
  .app-side { display: none; }
  .steps { grid-template-columns: 1fr 1fr; gap: 40px 20px; }
  .today-grid { grid-template-columns: 1fr; gap: 56px; }
}

@media (max-width: 880px) {
  .site-nav { display: none; }
  .section { padding: 88px 0; }

  .app { height: auto; }
  .app-cols { grid-template-columns: 1fr; }
  .thread { display: none; }
  .inbox-list { overflow: visible; }

  .leak { padding: 88px 0 96px; }
  .leak-grid { grid-template-columns: 1fr; gap: 0; margin-top: 48px; }
  .leak-visual { top: 84px; z-index: 2; }
  .leak-card { padding: 16px; }
  .leak-metrics { padding: 12px 0 10px; }
  .metric-value { font-size: 1.9rem; }
  .leak-track { display: none; }
  .leak-status { margin-top: 12px; }
  .leak-step { min-height: 62vh; justify-content: flex-end; padding-bottom: 40px; }
  .leak-step:first-child { min-height: 50vh; }
  .leak-close { margin-top: 48px; }

  .position { padding: 96px 0; }
  .pipeline { grid-template-columns: 1fr; margin-top: 56px; }
  .pipeline::before { left: 50%; right: auto; top: 0; bottom: 0; width: 2px; height: auto; }
  .pipe-stage, .pipe-stage:first-child, .pipe-stage:last-child {
    margin: 0 16px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: var(--radius-lg);
  }
  .pipe-stage:first-child { border-bottom: none; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .pipe-stage:last-child { border-top: none; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
  .pipe-stage.is-rumona { margin: 0; }
  .drips { display: none; }
  .position-note { margin-top: 56px; }

  .compare-row { grid-template-columns: 1fr; }
  .compare-labels { display: none; }
  .compare-row > * { padding: 14px 20px 14px 52px; }
  .compare-topic { padding: 20px 20px 4px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--indigo); }
  .c-before::before, .c-after::before { left: 20px; top: 18px; }

  .calc-card { grid-template-columns: 1fr; margin-top: 40px; }
  .calc-inputs { border-right: none; border-bottom: 1px solid var(--line); grid-template-columns: 1fr 1fr; gap: 22px 20px; }
  .calc-inputs, .calc-results { padding: 28px; }

  .cta-card { padding: 64px 28px; }
  .legal-body { padding: 28px 22px; }
  .contact-methods { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  :root { --gutter: 16px; }
  .site-header .container { height: 64px; }
  .site-header .btn-sm { padding: 0 12px; font-size: 0.85rem; }
  .hero { padding: 48px 0 72px; }
  .hero-subtitle { font-size: 1.02rem; }
  .hero-cta .btn { width: 100%; }
  .app-stage { margin-top: 48px; }
  .app-banner { padding: 10px 12px; }
  .app-replay { display: none; }
  .app-cols { padding: 10px; }
  .steps { grid-template-columns: 1fr; }
  .stats > div { padding: 0 16px; }
  .stat-num { font-size: 2rem; }
  .calc-inputs { grid-template-columns: 1fr; }
  .calc-inputs, .calc-results { padding: 22px 18px; }
  .calc-kpis { grid-template-columns: 1fr; gap: 18px; }
  .calc-cta { flex-direction: column; align-items: stretch; }
  .calc-cta .btn { width: 100%; }
  .cta-card { border-radius: 20px; }
  .cta-final .hero-cta .btn { width: 100%; }
  .site-footer .container { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; filter: none; }
}
