/* Safi marketing site v3. Brand: docs/safi-brand-guidelines-v1.2.md. RTL is the source of truth; logical properties only.
   Monochrome system, one accent (profit green) reserved for money and live data. Hidden motion states exist only under html.js. */

:root {
  --bg: #FFFFFF; --surface: #F7F7F8; --elevated: #FFFFFF;
  --border: rgba(10, 10, 10, 0.08); --border-strong: rgba(10, 10, 10, 0.16);
  --text: #0A0A0A; --text-2: #52525B; --text-3: #8A8A93;
  --profit: #0B8A45; --profit-fill: #00C853; --loss: #C62828;
  --btn-bg: #0A0A0A; --btn-fg: #FFFFFF; --btn-bg-hover: #27272A;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
  --shadow-card-hover: 0 2px 4px rgba(0, 0, 0, 0.05), 0 16px 40px rgba(0, 0, 0, 0.10);
  --font-latin: "Inter", system-ui, -apple-system, sans-serif;
  --font-arabic: "Noto Sans Arabic", system-ui, sans-serif;
  --font: var(--font-arabic), var(--font-latin);
  --r-card: 16px; --r-btn: 10px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --head-h: 4.25rem;
  --dir: 1; --origin-start: left;
}
html[lang="en"] { --font: var(--font-latin), var(--font-arabic); }
html[dir="rtl"] { --dir: -1; --origin-start: right; }
.dark {
  --bg: #0A0A0A; --surface: #121212; --elevated: #1A1A1A;
  --border: rgba(255, 255, 255, 0.10); --border-strong: rgba(255, 255, 255, 0.18);
  --text: #FAFAFA; --text-2: #A1A1AA; --text-3: #71717A;
  --profit: #35E07E; --loss: #FF6B62;
  --btn-bg: #FFFFFF; --btn-fg: #0A0A0A; --btn-bg-hover: #E4E4E7;
  --shadow-card: none; --shadow-card-hover: none;
  background: var(--bg); color: var(--text);
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: light; scroll-padding-block-start: calc(var(--head-h) + 1rem); }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 1rem; line-height: 1.65; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
html[lang="en"] body { line-height: 1.55; }
h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.25; }
html[lang="en"] h1, html[lang="en"] h2 { letter-spacing: -0.03em; line-height: 1.08; }
html[lang="en"] h3 { letter-spacing: -0.01em; }
p { margin: 0; }
a { color: inherit; }
ol, ul, dl { margin: 0; padding: 0; }
li { list-style: none; }
img, svg { display: block; max-width: 100%; }
.num { font-family: var(--font-latin); font-variant-numeric: tabular-nums lining-nums; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

.wrap { width: min(100% - 3rem, 75rem); margin-inline: auto; }
.section { padding-block: clamp(4rem, 8vw, 7.5rem); }
.section-head { max-width: 44ch; margin-block-end: clamp(2rem, 4vw, 3.5rem); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head h2 { font-size: clamp(1.9rem, 1.2rem + 2.4vw, 3rem); }
.section-head p { margin-block-start: 1rem; color: var(--text-2); font-size: 1.1rem; max-width: 56ch; }
.section-head.center p { margin-inline: auto; }
.eyebrow { font-size: 0.85rem; font-weight: 500; color: var(--text-3); margin-block-end: 0.9rem; }
.surface { background: var(--surface); }

/* Mark and wordmark */
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; font-weight: 700; font-size: 1.2rem; }
.mark { width: 30px; height: 30px; border-radius: 8px; background: var(--text); color: var(--bg); display: grid; place-items: center; position: relative; font-family: var(--font-arabic); font-weight: 700; font-size: 1rem; line-height: 1; }
.mark::after { content: ""; position: absolute; inset-block-end: 4px; width: 11px; height: 3px; border-radius: 2px; background: var(--profit-fill); }
.mark.lg { width: 48px; height: 48px; border-radius: 12px; font-size: 1.5rem; }
.mark.lg::after { width: 18px; height: 4px; inset-block-end: 7px; }
.brand-latin { font-family: var(--font-latin); font-weight: 600; letter-spacing: -0.02em; }

/* Header */
.site-head { position: sticky; top: 0; z-index: 20; height: var(--head-h); display: flex; align-items: center; border-block-end: 1px solid transparent; transition: background-color 220ms ease-out, color 220ms ease-out, border-color 220ms ease-out; }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.site-head.on-dark { color: #FAFAFA; --text: #FAFAFA; --text-2: #A1A1AA; --bg: #0A0A0A; --border-strong: rgba(255,255,255,0.18); --btn-bg: #FFFFFF; --btn-fg: #0A0A0A; --btn-bg-hover: #E4E4E7; }
.site-head.is-stuck { background: rgba(255, 255, 255, 0.82); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-color: rgba(10, 10, 10, 0.08); color: #0A0A0A; --text: #0A0A0A; --bg: #FFFFFF; --text-2: #52525B; --border-strong: rgba(10,10,10,0.16); --btn-bg: #0A0A0A; --btn-fg: #FFFFFF; --btn-bg-hover: #27272A; }
.site-nav { display: flex; align-items: center; gap: 1.5rem; }
.site-nav a { text-decoration: none; font-weight: 500; font-size: 0.95rem; color: var(--text-2); transition: color 160ms; }
.site-nav a:hover { color: var(--text); }
.site-nav .btn-primary, .site-nav .btn-primary:hover { color: var(--btn-fg); }
.site-nav .links { display: flex; gap: 1.5rem; }
@media (max-width: 52rem) { .site-nav .links { display: none; } }
@media (max-width: 40rem) { .site-nav .btn { display: none; } }

/* Buttons and fields */
.btn { font: inherit; font-weight: 500; font-size: 0.95rem; height: 44px; padding-inline: 1.15rem; border-radius: var(--r-btn); border: 1px solid transparent; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; white-space: nowrap; transition: background-color 180ms ease-out, border-color 180ms ease-out, color 180ms ease-out, transform 180ms ease-out; }
.btn-primary { background: var(--btn-bg); color: var(--btn-fg); }
.btn-primary:hover { background: var(--btn-bg-hover); }
.btn-primary:disabled { opacity: 0.6; cursor: default; }
.btn-secondary { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn-secondary:hover { border-color: var(--text); }
.btn .arrow { transition: transform 180ms var(--ease); }
.btn:hover .arrow { transform: translateX(calc(3px * var(--dir))); }
.field { display: grid; gap: 0.4rem; }
.field label, .field .lbl { font-weight: 500; font-size: 0.9rem; color: var(--text-2); }
.field input { font: inherit; height: 48px; padding-inline: 0.95rem; border: 1px solid var(--border-strong); border-radius: var(--r-btn); background: var(--elevated); color: var(--text); width: 100%; transition: border-color 160ms; }
.field input::placeholder { color: var(--text-3); }
.field input:hover { border-color: var(--text-3); }
.dark .field input { background: rgba(255, 255, 255, 0.06); }
.seg { position: relative; display: flex; height: 48px; border: 1px solid var(--border-strong); border-radius: var(--r-btn); padding: 3px; background: var(--elevated); }
.dark .seg { background: rgba(255, 255, 255, 0.06); }
.seg::before { content: ""; position: absolute; inset-block: 3px; inset-inline-start: 3px; width: calc(50% - 3px); border-radius: 7px; background: var(--text); transition: translate 220ms var(--ease); }
.seg:has(.seg-opt:last-child input:checked)::before { translate: calc(100% * var(--dir)) 0; }
.seg-opt { flex: 1; position: relative; }
.seg-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.seg-opt span { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 0.4rem; height: 100%; border-radius: 7px; font-weight: 500; font-size: 0.9rem; cursor: pointer; color: var(--text-2); transition: color 220ms; }
.seg-opt img { height: 14px; width: auto; opacity: 0.8; }
.seg-opt:has(input:checked) span { color: var(--bg); }
.seg-opt:has(input:checked) img { filter: invert(1) grayscale(1) brightness(2); }
.dark .seg-opt:has(input:checked) img { filter: grayscale(1) brightness(0.2); }
.seg-opt:has(input:focus-visible) span { outline: 2px solid var(--text); outline-offset: 2px; }

/* Waitlist form */
.wl { display: grid; gap: 0.75rem; max-width: 40rem; }
.wl-row { display: grid; gap: 0.75rem; grid-template-columns: 1fr; }
@media (min-width: 48rem) { .wl-row { grid-template-columns: 11rem minmax(0, 1fr) auto; align-items: end; } }
.wl .hp { position: absolute; inset-inline-start: -9999px; }
.wl-note { color: var(--text-3); font-size: 0.85rem; }
.wl-msg { font-size: 0.9rem; min-height: 1.4em; }
.wl-msg.is-ok { color: var(--profit); font-weight: 500; }
.wl-msg.is-err { color: var(--loss); }
.wl.center { margin-inline: auto; }
.wl.center .wl-note, .wl.center .wl-msg { text-align: center; }

/* Hero */
.hero { position: relative; padding-block-start: calc(var(--head-h) + clamp(2.5rem, 6vw, 5rem)); margin-block-start: calc(-1 * var(--head-h)); text-align: center; }
.hero::before { content: ""; position: absolute; inset-inline: 0; inset-block-start: 45%; height: 55%; background: radial-gradient(55% 50% at 50% 50%, rgba(0, 200, 83, 0.16), transparent 70%); pointer-events: none; }
.hero .wrap { position: relative; }
.pill { display: inline-flex; align-items: center; gap: 0.55rem; border: 1px solid var(--border); border-radius: 999px; padding: 0.35rem 0.9rem 0.35rem 0.55rem; font-size: 0.85rem; font-weight: 500; color: var(--text-2); background: rgba(255, 255, 255, 0.04); }
.pill img { height: 16px; width: auto; }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--profit-fill); }
.hero h1 { font-size: clamp(2.4rem, 1.4rem + 4.2vw, 5rem); max-width: 24ch; margin: 1.5rem auto 0; }
@media (max-width: 40rem) { .hero h1 br { display: none; } }
.hero .lead { font-size: clamp(1.05rem, 1rem + 0.4vw, 1.3rem); color: var(--text-2); max-width: 46ch; margin: 1.25rem auto 2rem; }
.hero .wl { margin-inline: auto; }
.hero-shot { position: relative; margin-block-start: clamp(2.5rem, 5vw, 4rem); margin-block-end: -6rem; z-index: 2; }
.after-hero { padding-block-start: 9rem; }

/* Browser window mock */
.window { background: #121212; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 14px; overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(0, 0, 0, 0.4); color: #FAFAFA; text-align: start; max-width: 68rem; margin-inline: auto; --border: rgba(255,255,255,.10); --text-2: #A1A1AA; --text-3: #71717A; --profit: #35E07E; --loss: #FF6B62; }
.window.light { background: #FFFFFF; color: #0A0A0A; border-color: rgba(10, 10, 10, 0.08); box-shadow: var(--shadow-card-hover); --border: rgba(10,10,10,.08); --text-2: #52525B; --text-3: #8A8A93; --profit: #0B8A45; --loss: #C62828; }
.window-bar { display: flex; align-items: center; gap: 0.5rem; padding: 0.7rem 0.9rem; border-block-end: 1px solid var(--border); }
.window-bar i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, 0.14); }
.window.light .window-bar i { background: rgba(10, 10, 10, 0.12); }
.window-bar .url { margin-inline-start: 0.75rem; font: 500 0.75rem var(--font-latin); color: var(--text-3); background: rgba(127, 127, 127, 0.12); border-radius: 6px; padding: 0.25rem 0.6rem; }
.dash { display: grid; grid-template-columns: 12rem 1fr; }
@media (max-width: 48rem) { .dash { grid-template-columns: 1fr; } .dash-side { display: none; } }
.dash-side { border-inline-end: 1px solid var(--border); padding: 1rem 0.9rem; display: grid; align-content: start; gap: 0.25rem; font-size: 0.85rem; }
.dash-side .brand { font-size: 1rem; margin-block-end: 0.9rem; }
.dash-side a { display: block; padding: 0.45rem 0.6rem; border-radius: 8px; color: var(--text-2); text-decoration: none; }
.dash-side a.on { background: rgba(127, 127, 127, 0.14); color: inherit; font-weight: 500; }
.dash-main { padding: 1.1rem; display: grid; gap: 1rem; align-content: start; }
.dash-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; font-size: 0.85rem; color: var(--text-2); }
.dash-top strong { font-size: 1rem; color: inherit; font-weight: 600; }
.chips { display: flex; gap: 0.35rem; }
.chip { border: 1px solid var(--border); border-radius: 999px; padding: 0.2rem 0.65rem; font-size: 0.75rem; font-weight: 500; }
.chip.on { background: rgba(127, 127, 127, 0.16); }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem; }
@media (max-width: 40rem) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpis.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kpi { border: 1px solid var(--border); border-radius: 12px; padding: 0.9rem 1rem; display: grid; gap: 0.35rem; }
.kpi .lbl { font-size: 0.75rem; color: var(--text-3); font-weight: 500; }
.kpi .val { font: 600 clamp(1.3rem, 1rem + 1vw, 1.75rem) var(--font-latin); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi .val small { font-size: 0.55em; font-weight: 500; color: var(--text-2); margin-inline-start: 0.2em; letter-spacing: 0; }
.kpi .d { font-size: 0.75rem; font-weight: 500; }
.up { color: var(--profit); } .down { color: var(--loss); }
.est { color: var(--text-3); text-decoration: underline dashed; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.panel { border: 1px solid var(--border); border-radius: 12px; padding: 1rem; }
.panel .ph { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.8rem; color: var(--text-3); margin-block-end: 0.6rem; }
.panel .ph strong { color: inherit; font-weight: 500; font-size: 0.85rem; }
.chart { width: 100%; height: auto; }
.chart .grid { stroke: var(--border); }
.chart .line { fill: none; stroke: var(--profit-fill); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart .area { fill: rgba(0, 200, 83, 0.08); }
.chart .bar { fill: rgba(127, 127, 127, 0.2); }
.chart .bar.hi { fill: var(--profit-fill); }
.two { display: grid; grid-template-columns: 3fr 2fr; gap: 1rem; }
@media (max-width: 48rem) { .two { grid-template-columns: 1fr; } }
.tbl { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.tbl th { text-align: start; font-weight: 500; color: var(--text-3); padding: 0.45rem 0.5rem; border-block-end: 1px solid var(--border); font-size: 0.75rem; white-space: nowrap; }
.tbl td { padding: 0.65rem 0.5rem; border-block-end: 1px solid var(--border); vertical-align: middle; }
.tbl td.r { white-space: nowrap; }
.tbl tr:last-child td { border-block-end: 0; }
.tbl .r { text-align: end; }
.tbl .thumb { display: inline-block; width: 26px; height: 26px; border-radius: 7px; background: rgba(127, 127, 127, 0.22); vertical-align: middle; margin-inline-end: 0.5rem; }
.tbl .ch { display: inline-flex; align-items: center; gap: 0.45rem; }
.tbl .ch img { width: 16px; height: 16px; }
.bar { height: 6px; border-radius: 3px; background: rgba(127, 127, 127, 0.18); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--profit-fill); border-radius: 3px; }
.bar i.warn { background: var(--loss); }

/* Logo bar */
.logos { display: flex; flex-wrap: wrap; align-items: start; justify-content: center; gap: 1.5rem 2.75rem; }
.logos p { width: 100%; text-align: center; color: var(--text-3); font-size: 0.85rem; font-weight: 500; margin-block-end: 0.5rem; }
.logos .lg { margin: 0; display: grid; justify-items: center; gap: 0.6rem; font-size: 0.8rem; font-weight: 500; color: var(--text-3); }
.logos .lg img { height: 34px; width: auto; max-width: 96px; object-fit: contain; filter: grayscale(1) contrast(0) brightness(1.15); opacity: 0.9; transition: filter 200ms, opacity 200ms; }
.logos .lg:hover img { filter: none; opacity: 1; }

/* Integration diagram */
.diagram { position: relative; max-width: 50rem; margin-inline: auto; }
#how { padding-block-start: clamp(2.5rem, 5vw, 4rem); }
#how .section-head { margin-block-end: clamp(1rem, 2.5vw, 1.75rem); }
#how .section-head p { font-size: 1rem; }
.diagram-desk { position: relative; aspect-ratio: 1100 / 560; display: none; }
.diagram-mob { display: grid; gap: 1rem; }
@media (min-width: 60rem) { .diagram-desk { display: block; } .diagram-mob { display: none; } }
.diagram svg.flows { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
html[dir="rtl"] .diagram svg.flows { transform: scaleX(-1); }
.flows .base { fill: none; stroke: var(--border-strong); stroke-width: 1.5; }
.flows .live { fill: none; stroke: var(--profit-fill); stroke-width: 1.5; stroke-dasharray: 5 16; stroke-linecap: round; animation: dash 1.8s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -42; } }
.node { position: absolute; display: flex; align-items: center; gap: 0.6rem; background: var(--elevated); border: 1px solid var(--border); border-radius: 12px; padding: 0.55rem 0.8rem; box-shadow: var(--shadow-card); font-weight: 500; font-size: 0.85rem; line-height: 1.25; width: 22%; }
.node img { width: 22px; height: 22px; flex: none; object-fit: contain; }
.node img.wide { width: 40px; height: 20px; }
.node small { display: block; font-weight: 400; color: var(--text-3); font-size: 0.7rem; line-height: 1.2; }
.core { position: absolute; inset-inline-start: 40%; width: 20%; inset-block-start: 26%; height: 48%; background: #0A0A0A; color: #FAFAFA; border-radius: 20px; display: grid; place-items: center; align-content: center; gap: 0.5rem; text-align: center; padding: 1rem; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25); }
.core .mark { background: #FFFFFF; color: #0A0A0A; }
.core strong { font-size: 1.1rem; }
.core small { color: #A1A1AA; font-size: 0.72rem; line-height: 1.3; }
.diagram-mob .grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
.diagram-mob .node { position: static; width: auto; white-space: normal; }
.diagram-mob .core { position: static; width: auto; height: auto; padding: 1.5rem; }
.diagram-mob .down { text-align: center; color: var(--text-3); font-size: 1.25rem; line-height: 1; }

/* Product rows */
.row { display: grid; gap: clamp(2.5rem, 6vw, 6rem); align-items: center; }
@media (min-width: 60rem) { .row { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); } .row.flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); } .row.flip > .copy { order: 2; } }
.row > .window { width: 100%; max-width: none; margin-inline: 0; }
.row + .row { margin-block-start: clamp(4rem, 8vw, 7rem); }
.copy h2 { font-size: clamp(1.7rem, 1.1rem + 2vw, 2.5rem); max-width: 17ch; }
.copy p { margin-block-start: 1rem; color: var(--text-2); font-size: 1.05rem; max-width: 46ch; }
.checks { margin-block-start: 1.5rem; display: grid; gap: 0.75rem; }
.checks li { display: flex; gap: 0.7rem; align-items: flex-start; color: var(--text-2); }
.checks li::before { content: ""; flex: none; width: 20px; height: 20px; margin-block-start: 0.15rem; border-radius: 50%; background: var(--profit-fill); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='10' fill='%23000'/%3E%3Cpath d='M6 10.5l2.6 2.5L14 7.5' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='10' fill='%23000'/%3E%3Cpath d='M6 10.5l2.6 2.5L14 7.5' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }

/* Phone mock */
.phone { width: min(100%, 16.5rem); margin-inline: auto; background: #0A0A0A; border-radius: 2.6rem; padding: 0.6rem; aspect-ratio: 9 / 18.6; box-shadow: var(--shadow-card-hover); }
.phone-screen { height: 100%; background: #F7F7F8; color: #0A0A0A; border-radius: 2.05rem; padding: 0 0.85rem 1rem; display: flex; flex-direction: column; overflow: hidden; }
.phone-notch { width: 34%; height: 1.4rem; background: #0A0A0A; border-end-start-radius: 1rem; border-end-end-radius: 1rem; margin-inline: auto; margin-block-end: 0.6rem; }
.chat-head { display: flex; align-items: center; gap: 0.6rem; padding-block: 0.3rem 0.7rem; border-block-end: 1px solid rgba(10, 10, 10, 0.08); font-size: 0.85rem; }
.chat-head .mark { width: 30px; height: 30px; }
.chat-name { font-weight: 600; }
.chat-time { margin-inline-start: auto; color: #8A8A93; font-size: 0.75rem; }
.msg { background: #FFFFFF; border-radius: 14px; border-start-start-radius: 4px; padding: 0.8rem 0.9rem; margin-block-start: 0.9rem; max-width: 94%; align-self: flex-start; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06); }
.msg-line { display: block; font-size: 0.9rem; line-height: 1.55; }
.msg-line.first { font-weight: 600; font-size: 1rem; }
.msg-time { display: block; text-align: end; font-size: 0.68rem; color: #8A8A93; margin-block-start: 0.35rem; }

/* Cards */
.cards { display: grid; gap: 1rem; }
@media (min-width: 48rem) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 64rem) { .cards.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.card { background: var(--elevated); border: 1px solid var(--border); border-radius: var(--r-card); padding: 1.5rem; box-shadow: var(--shadow-card); transition: transform 200ms var(--ease), box-shadow 200ms var(--ease); }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card-hover); }
.dark .card { background: rgba(255, 255, 255, 0.04); }
.card h3 { font-size: 1.15rem; }
.card p { margin-block-start: 0.5rem; color: var(--text-2); font-size: 0.98rem; }
.card .big { font: 600 2.25rem var(--font-latin); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; margin-block-end: 0.5rem; }
.card .logo-row { display: flex; gap: 0.5rem; margin-block-end: 0.9rem; }
.card .logo-row img { width: 22px; height: 22px; object-fit: contain; }

/* Final CTA */
.final { text-align: center; }
.final h2 { font-size: clamp(2rem, 1.3rem + 3vw, 3.75rem); max-width: 18ch; margin-inline: auto; }
.final p { margin: 1rem auto 2rem; color: var(--text-2); font-size: 1.1rem; max-width: 46ch; }

/* Footer */
.site-foot { border-block-start: 1px solid var(--border); padding-block: 2.5rem 3rem; color: var(--text-3); font-size: 0.88rem; }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 1.25rem 2rem; align-items: center; justify-content: space-between; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.site-foot a { color: var(--text-2); text-decoration: none; }
.site-foot a:hover { color: var(--text); }

/* Prose pages */
.prose { max-width: 62ch; padding-block: clamp(2rem, 6vw, 4rem); }
.prose h1 { font-size: clamp(1.9rem, 1.2rem + 2.4vw, 2.75rem); margin-block-end: 1.5rem; }
.prose h2 { font-size: 1.3rem; margin-block: 2rem 0.5rem; }
.prose p, .prose li { color: var(--text-2); margin-block: 0.5rem; }
.prose .meta { color: var(--text-3); font-size: 0.9rem; }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  @keyframes rise { from { opacity: 0; translate: 0 14px; } to { opacity: 1; translate: 0 0; } }
  @keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
  @keyframes shot { from { opacity: 0; translate: 0 32px; } to { opacity: 1; translate: 0 0; } }
  .js .site-head { animation: fadein 500ms ease-out both; }
  .js .hero > .wrap > .pill { animation: rise 600ms var(--ease) 60ms both; }
  .js .hero h1 { animation: rise 700ms var(--ease) 140ms both; }
  .js .hero .lead { animation: rise 600ms var(--ease) 260ms both; }
  .js .hero .wl { animation: fadein 500ms ease-out 360ms both; }
  .js .hero-shot { animation: shot 900ms var(--ease) 480ms both; }
  .js .hero::before { animation: fadein 1200ms ease-out 700ms both; }
  .js [data-reveal=""]:not(.is-in) > * { opacity: 0; translate: 0 14px; }
  .js [data-reveal=""].is-in > * { transition: opacity 600ms var(--ease), translate 600ms var(--ease); transition-delay: calc(var(--i, 0) * 60ms); }
  .js [data-reveal="self"]:not(.is-in) { opacity: 0; translate: 0 18px; }
  .js [data-reveal="self"].is-in { transition: opacity 700ms var(--ease), translate 700ms var(--ease); }
  .js .msg[data-reveal="digest"] { --stagger: 220ms; }
  .js .msg[data-reveal="digest"]:not(.is-in) > * { opacity: 0; translate: 0 8px; }
  .js .msg[data-reveal="digest"].is-in > * { transition: opacity 500ms var(--ease), translate 500ms var(--ease); transition-delay: calc(var(--i, 0) * var(--stagger)); }
  /* Hero dashboard: KPIs cascade, the chart line draws, top products arrive */
  @keyframes drawline { to { stroke-dashoffset: 0; } }
  .js .hero .kpi { animation: rise 500ms var(--ease) both; animation-delay: calc(1000ms + var(--i, 0) * 80ms); }
  .js .hero .chart .line { stroke-dasharray: 1500; stroke-dashoffset: 1500; animation: drawline 1600ms var(--ease) 1250ms forwards; }
  .js .hero .chart .area { animation: fadein 900ms ease-out 1900ms both; }
  .js .hero .dash tbody tr { animation: rise 450ms var(--ease) both; animation-delay: calc(1400ms + var(--i, 0) * 90ms); }
  /* Product windows: rows cascade and bars grow once the window is in view */
  .js .window.shot:not(.is-in) tbody tr { opacity: 0; translate: 0 6px; }
  .js .window.shot.is-in tbody tr { transition: opacity 500ms var(--ease), translate 500ms var(--ease); transition-delay: calc(250ms + var(--i, 0) * 80ms); }
  .js .window.shot:not(.is-in) .bar i { transform: scaleX(0); }
  .js .window.shot.is-in .bar i { transform: scaleX(1); transform-origin: var(--origin-start) center; transition: transform 900ms var(--ease); transition-delay: calc(500ms + var(--i, 0) * 80ms); }
  .window.shot { transition: transform 300ms var(--ease), box-shadow 300ms var(--ease); }
  .window.shot:hover { transform: translateY(-3px); }
  /* Diagram: nodes arrive in sequence, the core settles, then the lines start flowing */
  .js .diagram:not(.is-in) .node { opacity: 0; translate: 0 10px; }
  .js .diagram.is-in .node { transition: opacity 500ms var(--ease), translate 500ms var(--ease); transition-delay: calc(150ms + var(--i, 0) * 90ms); }
  .js .diagram:not(.is-in) .core { opacity: 0; scale: 0.96; }
  .js .diagram.is-in .core { transition: opacity 600ms var(--ease) 500ms, scale 600ms var(--ease) 500ms; }
  .js .diagram:not(.is-in) .flows { opacity: 0; }
  .js .diagram.is-in .flows { transition: opacity 700ms ease-out 1000ms; }
  /* Copy blocks: check items follow the paragraph */
  .js .copy[data-reveal=""]:not(.is-in) .checks li { opacity: 0; translate: 0 8px; }
  .js .copy[data-reveal=""].is-in .checks li { transition: opacity 500ms var(--ease), translate 500ms var(--ease); }
  .js .copy[data-reveal=""].is-in .checks li:nth-child(1) { transition-delay: 320ms; }
  .js .copy[data-reveal=""].is-in .checks li:nth-child(2) { transition-delay: 400ms; }
  .js .copy[data-reveal=""].is-in .checks li:nth-child(3) { transition-delay: 480ms; }
}
@media (prefers-reduced-motion: reduce) {
  .js [data-reveal=""]:not(.is-in) > *, .js [data-reveal="self"]:not(.is-in), .js .msg[data-reveal="digest"]:not(.is-in) > * { opacity: 0; }
  .js [data-reveal=""].is-in > *, .js [data-reveal="self"].is-in, .js .msg[data-reveal="digest"].is-in > * { transition: opacity 250ms ease-out; }
  .flows .live { animation: none; }
  .js .sk-label { opacity: 1; transition: none; }
  .js .window.shot:not(.is-in) tbody tr, .js .diagram:not(.is-in) .node, .js .diagram:not(.is-in) .core, .js .diagram:not(.is-in) .flows, .js .copy[data-reveal=""]:not(.is-in) .checks li { opacity: 1; translate: 0 0; scale: 1; }
  .js .window.shot:not(.is-in) .bar i { transform: none; }
}

/* WhatsApp chat depiction */
.phone.wa .phone-screen { padding: 0; background: #EFEAE2; }
.wa-head { position: relative; background: #008069; color: #FFFFFF; padding: 2.1rem 0.8rem 0.65rem; display: flex; align-items: center; gap: 0.6rem; }
.wa-head .phone-notch { position: absolute; inset-block-start: 0; inset-inline-start: 50%; translate: calc(-50% * var(--dir)) 0; margin: 0; }
.wa-head .mark { width: 34px; height: 34px; background: #FFFFFF; color: #0A0A0A; }
.wa-back { font-size: 1.4rem; line-height: 1; opacity: 0.9; transform: scaleX(var(--dir)); }
.wa-title { font-weight: 600; font-size: 0.95rem; line-height: 1.15; }
.wa-title small { display: block; font-weight: 400; font-size: 0.7rem; opacity: 0.85; }
.wa-icons { margin-inline-start: auto; display: flex; gap: 0.8rem; }
.wa-icons i { width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, 0.9); border-radius: 4px; }
.wa-icons i:nth-child(2) { border-radius: 50%; }
.wa-icons i:nth-child(3) { width: 4px; border: 0; background: rgba(255, 255, 255, 0.9); border-radius: 2px; }
.wa-chat { flex: 1; display: flex; flex-direction: column; padding: 0.7rem 0.7rem 0; gap: 0.6rem; }
.wa-date { align-self: center; background: #FFFFFF; color: #54656F; border-radius: 8px; padding: 0.2rem 0.6rem; font-size: 0.7rem; box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13); }
.wa-msg { position: relative; background: #FFFFFF; border-radius: 10px; border-start-start-radius: 0; padding: 0.5rem 0.65rem 0.35rem; max-width: 96%; align-self: flex-start; box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13); color: #111B21; }
.wa-msg::before { content: ""; position: absolute; inset-block-start: 0; inset-inline-start: -7px; border-block-start: 8px solid #FFFFFF; border-inline-start: 7px solid transparent; }
.wa-msg .msg-line { font-size: 0.86rem; line-height: 1.5; }
.wa-msg .msg-line.first { font-weight: 600; font-size: 0.86rem; }
.wa-time { display: block; text-align: end; font-size: 0.62rem; color: #667781; margin-block-start: 0.15rem; }
.wa-foot { display: flex; align-items: center; gap: 0.5rem; padding: 0.6rem 0.6rem 0.7rem; }
.wa-input { flex: 1; background: #FFFFFF; border-radius: 999px; padding: 0.55rem 0.95rem; font-size: 0.85rem; color: #8A8A93; }
.wa-mic { width: 38px; height: 38px; border-radius: 50%; background: #00A884; flex: none; }

/* Sankey: from sales to net, drawn as the user scrolls */
.sankey { position: relative; aspect-ratio: 1000 / 560; margin-block-start: 1.5rem; display: none; }
.sankey .draw { position: absolute; inset: 0; clip-path: inset(0 calc((1 - var(--p, 1)) * 100%) 0 0); }
html[dir="rtl"] .sankey .draw { clip-path: inset(0 0 0 calc((1 - var(--p, 1)) * 100%)); }
.sankey svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
html[dir="rtl"] .sankey svg { transform: scaleX(-1); }
.sankey .flow { fill: rgba(10, 10, 10, 0.09); }
.sankey .flow.net { fill: rgba(0, 200, 83, 0.30); }
.sankey .sk-node { fill: #3F3F46; }
.sankey .sk-node.sales { fill: #0A0A0A; }
.sankey .sk-node.net { fill: #00C853; }
.sk-label { position: absolute; display: inline-flex; align-items: baseline; gap: 0.4rem; font-size: 0.82rem; line-height: 1.2; white-space: nowrap; translate: 0 -50%; }
.sk-label b { font-family: var(--font-latin); font-variant-numeric: tabular-nums; font-weight: 600; font-size: 0.95rem; }
.sk-label.sales, .sk-label.net { display: grid; gap: 0.15rem; translate: 0 0; }
.sk-label.sales b { font-size: 1.35rem; }
.sk-label.net { text-align: end; }
.sk-label.net b { color: var(--profit); font-size: 1.9rem; letter-spacing: -0.02em; }
.sk-label .lr { display: inline-flex; gap: 0.3rem; margin-inline-start: 0.2rem; }
.sk-label .lr img { width: 13px; height: 13px; }
.js .sk-label { opacity: 0; transition: opacity 400ms ease-out; }
.js .sk-label.is-on { opacity: 1; }
.waterfall { display: grid; gap: 0; margin-block-start: 1.5rem; border-block-start: 1px solid var(--border); }
.waterfall li { display: flex; justify-content: space-between; gap: 1rem; padding-block: 0.65rem; border-block-end: 1px solid var(--border); font-size: 0.95rem; }
.waterfall li.minus { color: var(--text-2); }
.waterfall li.net { font-weight: 600; }
.waterfall li.net b { color: var(--profit); }
.sk-note { margin-block-start: 1.25rem; color: var(--text-3); font-size: 0.85rem; }
@media (min-width: 48rem) { .sankey { display: block; } .waterfall { display: none; } }

/* Pinned stage: the section is a tall scroll track, the visual stays in view and draws with scroll */
.pin { padding-block: 0; height: 240vh; }
.pin-stage { position: sticky; top: var(--head-h); height: calc(100vh - var(--head-h)); display: grid; align-content: center; padding-block: 1.5rem; box-sizing: border-box; }
.pin .section-head { margin-block-end: 1rem; }
.pin .section-head p { font-size: 1rem; }
.pin .sankey { margin-block-start: 0.5rem; width: min(100%, calc((100vh - 24rem) * 1.7857)); margin-inline: auto; }
.pin .sk-note { margin-block-start: 1rem; }
@media (max-width: 47.99rem) { .pin { height: auto; padding-block: clamp(4rem, 8vw, 7.5rem); } .pin-stage { position: static; height: auto; padding-block: 0; } }
@media (prefers-reduced-motion: reduce) { .pin { height: auto; padding-block: clamp(4rem, 8vw, 7.5rem); } .pin-stage { position: static; height: auto; padding-block: 0; } }
.js .sk-label { transition: opacity 250ms ease-out; }
