/* JONI public landing page (/ and /he/). The legal pages keep styles.css;
   nothing here is shared with them, so the two can change independently.
   Colors, type and radii mirror the D1 tokens in dashboard-ui/src/styles.css.
   Logical properties (inline/block) throughout, so /he/ mirrors with no
   RTL overrides beyond the few marked below. */

@font-face {
  font-family: 'Rubik Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 300 900;
  src: url(/fonts/rubik-hebrew-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}

@font-face {
  font-family: 'Rubik Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 300 900;
  src: url(/fonts/rubik-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --joni-navy: #081f66;
  --joni-navy-900: #061650;
  --joni-purple: #7a43ff;
  --joni-blue: #2e7bff;
  --joni-periwinkle: #8fb5ff;
  --joni-purple-600: #6b35f0; /* white text 6.19:1 */
  --joni-purple-700: #5a27db;
  --joni-blue-600: #1f5fe0; /* 5.57:1 on white */

  --color-bg: #ffffff;
  --color-bg-soft: #f6f7fb;
  --color-surface: #ffffff;
  --color-border: #dce1ec;
  --color-text: #151b2e;
  --color-heading: var(--joni-navy);
  --color-text-muted: #5b6478; /* 5.9:1 on white */
  --color-on-navy: #ffffff;
  --color-on-navy-muted: #c3cdf0; /* 9.6:1 on navy */
  --color-focus: var(--joni-blue-600);
  --gradient-brand: linear-gradient(135deg, var(--joni-purple-600), var(--joni-blue-600));

  --font-sans: 'Rubik Variable', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --radius-control: 12px;
  --radius: 16px;
  --radius-lg: 28px;
  --radius-pill: 999px;

  --shadow: 0 1px 2px rgba(8, 31, 102, .06), 0 2px 8px rgba(8, 31, 102, .05);
  --shadow-lg: 0 24px 60px -18px rgba(8, 31, 102, .28), 0 8px 20px -10px rgba(8, 31, 102, .12);

  --max: 1120px;
  --gutter: clamp(16px, 5vw, 32px);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }

html {
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-inline-size: 100%; }

a { color: var(--joni-blue-600); }

:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: 6px;
}

h1, h2, h3 {
  margin: 0;
  color: var(--color-heading);
  line-height: 1.12;
  letter-spacing: -.02em;
}

/* Hebrew has no case and reads better without negative tracking. */
:lang(he) h1, :lang(he) h2, :lang(he) h3 { letter-spacing: 0; }

p { margin: 0; }

.container {
  inline-size: min(100% - 2 * var(--gutter), var(--max));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  display: inline-flex;
  align-items: center;
  min-block-size: 44px;
  inset-inline-start: 12px;
  inset-block-start: -100px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius-control);
  background: var(--joni-navy);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus { inset-block-start: 12px; }

/* ---- Navigation ------------------------------------------------------ */

.site-header {
  position: sticky;
  inset-block-start: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-block-end: 1px solid rgba(220, 225, 236, .7);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-block-size: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-block-size: 44px;
  min-inline-size: 44px;
  color: var(--color-heading);
  text-decoration: none;
}

.brand img {
  inline-size: 36px;
  block-size: 36px;
}

.brand-wordmark {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: .06em;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  min-block-size: 44px;
  padding-inline: 12px;
  border-radius: var(--radius-pill);
  color: var(--color-text-muted);
  font-size: .9375rem;
  font-weight: 500;
  text-decoration: none;
}

.lang-switch:hover {
  color: var(--color-heading);
  background: var(--color-bg-soft);
}

/* ---- Buttons --------------------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-block-size: 48px;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background-color .2s var(--ease);
}

.button-primary {
  color: #fff;
  background: var(--gradient-brand);
  box-shadow: 0 10px 24px -10px rgba(107, 53, 240, .65);
}

.button-primary:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 14px 30px -10px rgba(107, 53, 240, .75);
}

.button-primary:active { transform: translateY(0); }

.button-ghost {
  color: var(--color-heading);
  background: transparent;
}

.button-ghost:hover { background: var(--color-bg-soft); }

.button-small {
  min-block-size: 44px;
  padding: 10px 18px;
  font-size: .9375rem;
}

.arrow {
  display: inline-block;
  transition: transform .2s var(--ease);
}

.button:hover .arrow { transform: translateX(3px); }
[dir="rtl"] .button:hover .arrow { transform: translateX(-3px); }
.button:hover .arrow-down { transform: translateY(2px); }
[dir="rtl"] .button:hover .arrow-down { transform: translateY(2px); }

/* ---- Hero ------------------------------------------------------------ */

.hero {
  position: relative;
  isolation: isolate;
  padding-block: clamp(56px, 10vw, 120px) clamp(64px, 10vw, 112px);
  overflow: hidden;
}

/* Two soft brand-colored glows; decorative only. */
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  filter: blur(70px);
  pointer-events: none;
}

.hero::before {
  inset-block-start: -180px;
  inset-inline-end: -120px;
  inline-size: 560px;
  block-size: 560px;
  background: radial-gradient(circle, rgba(122, 67, 255, .26), transparent 65%);
}

.hero::after {
  inset-block-end: -340px;
  inset-inline-start: -160px;
  inline-size: 520px;
  block-size: 520px;
  background: radial-gradient(circle, rgba(46, 123, 255, .18), transparent 65%);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  align-items: center;
  gap: clamp(40px, 6vw, 80px);
}

.hero-brand {
  display: block;
  margin-block-end: 18px;
  font-size: clamp(.875rem, 1.4vw, 1rem);
  font-weight: 700;
  letter-spacing: .32em;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-title {
  display: block;
  font-size: clamp(2.75rem, 7.4vw, 5.25rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -.035em;
}

.hero-lead {
  max-inline-size: 34rem;
  margin-block-start: 24px;
  color: var(--color-text-muted);
  font-size: clamp(1.0625rem, 1.7vw, 1.25rem);
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-block-start: 36px;
}

/* Product sketch: what one automation looks like. Decorative (aria-hidden);
   it shows only the comment-keyword → private-reply flow the product ships. */
.preview {
  position: relative;
  justify-self: center;
  inline-size: min(100%, 400px);
  margin: 0;
}

.preview-card {
  position: relative;
  padding: 22px;
  border: 1px solid rgba(220, 225, 236, .9);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, .9);
  box-shadow: var(--shadow-lg);
}

.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-block-end: 18px;
}

.preview-name {
  color: var(--color-heading);
  font-weight: 600;
}

/* Labels the card as a sample, so it never reads as someone's live data. */
.preview-badge {
  padding: 3px 10px;
  border: 1px dashed #b8c0d4;
  border-radius: var(--radius-pill);
  color: var(--color-text-muted);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}

:lang(he) .preview-badge { letter-spacing: 0; }

.preview-caption {
  margin-block-start: 14px;
  color: var(--color-text-muted);
  font-size: .8125rem;
  text-align: center;
}

.preview-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--color-bg-soft);
}

.preview-row + .preview-row { margin-block-start: 10px; }

.preview-label {
  display: block;
  color: var(--color-text-muted);
  font-size: .75rem;
  font-weight: 500;
}

.preview-value {
  display: block;
  color: var(--color-heading);
  font-size: .9375rem;
  font-weight: 600;
}

.preview-thumb {
  flex: 0 0 44px;
  block-size: 44px;
  border-radius: 10px;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .45), transparent 45%),
    linear-gradient(135deg, var(--joni-purple), var(--joni-blue) 60%, var(--joni-periwinkle));
}

.preview-keyword {
  display: inline-block;
  margin-inline-start: auto;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: #eee7ff;
  color: var(--joni-purple-700);
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .04em;
}

.preview-icon {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  block-size: 44px;
  border-radius: 10px;
  background: #fff;
  color: var(--joni-purple-600);
  box-shadow: var(--shadow);
}

.preview-icon svg { inline-size: 22px; block-size: 22px; }

.preview-row > span:not([class]) { flex: 1 1 auto; min-inline-size: 0; }

.preview-bubble {
  display: block;
  inline-size: fit-content;
  margin-block-start: 6px;
  padding: 10px 14px;
  border-radius: 16px 16px 16px 4px;
  background: var(--gradient-brand);
  color: #fff;
  font-size: .875rem;
  line-height: 1.45;
}

[dir="rtl"] .preview-bubble { border-radius: 16px 16px 4px 16px; }

.preview-connector {
  inline-size: 2px;
  block-size: 14px;
  margin-block: 2px;
  margin-inline-start: 33px;
  background: linear-gradient(var(--joni-periwinkle), transparent);
}

/* ---- Sections -------------------------------------------------------- */

.section {
  padding-block: clamp(72px, 10vw, 128px);
  scroll-margin-block-start: 68px;
}

.section-head {
  max-inline-size: 40rem;
  margin-block-end: clamp(36px, 5vw, 56px);
}

.eyebrow {
  margin-block-end: 12px;
  color: var(--joni-purple-600);
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}

:lang(he) .eyebrow { letter-spacing: .04em; }

.section-title {
  font-size: clamp(2rem, 4.4vw, 3rem);
  font-weight: 700;
}

/* Two-sentence headings break between the sentences, never inside one
   (e.g. not "…יותר קשר / עם הקהל."). A phrase wider than the column
   still wraps inside itself. */
.phrase { display: inline-block; }

h1, h2 { text-wrap: balance; }

.section-lead {
  margin-block-start: 14px;
  color: var(--color-text-muted);
  font-size: clamp(1.0625rem, 1.5vw, 1.1875rem);
}

/* How it works */
.how { background: var(--color-bg-soft); }

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.step {
  position: relative;
  padding: 28px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}

.step:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.step-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-block-end: 28px;
}

.step-icon {
  display: grid;
  place-items: center;
  inline-size: 48px;
  block-size: 48px;
  border-radius: 14px;
  background: var(--gradient-brand);
  color: #fff;
}

.step-icon svg { inline-size: 24px; block-size: 24px; }

.step-number {
  color: #b8c0d4;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.step h3 {
  margin-block-end: 8px;
  font-size: 1.25rem;
  font-weight: 600;
}

.step p { color: var(--color-text-muted); }

/* Why JONI — the one dark band on the page. */
.why-panel {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(36px, 6vw, 72px);
  border-radius: clamp(24px, 3vw, 36px);
  background: var(--joni-navy);
  color: var(--color-on-navy);
}

.why-panel::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset-block-start: -40%;
  inset-inline-end: -10%;
  inline-size: 70%;
  block-size: 140%;
  background:
    radial-gradient(closest-side, rgba(122, 67, 255, .55), transparent),
    radial-gradient(closest-side at 70% 80%, rgba(46, 123, 255, .35), transparent);
  filter: blur(40px);
}

.why-panel .eyebrow { color: var(--joni-periwinkle); }
.why-panel .section-title { color: var(--color-on-navy); }

.benefits {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 48px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.benefit {
  padding-block-start: 22px;
  border-block-start: 1px solid rgba(195, 205, 240, .28);
}

.benefit h3 {
  margin-block-end: 8px;
  color: var(--color-on-navy);
  font-size: 1.1875rem;
  font-weight: 600;
}

.benefit p { color: var(--color-on-navy-muted); }

/* The dark band and the closing CTA sit close; no section needs double padding. */
.why { padding-block-end: 0; }

/* Final CTA */
.closing {
  text-align: center;
}

.closing .section-title {
  max-inline-size: 16ch;
  margin-inline: auto;
  font-size: clamp(2.25rem, 6vw, 4rem);
  letter-spacing: -.03em;
}

.closing .hero-actions { justify-content: center; }

.gradient-text {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---- Footer ---------------------------------------------------------- */

.site-footer {
  padding-block: 40px 48px;
  border-block-start: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: .875rem;
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px 40px;
}

.footer-brand .brand img { inline-size: 28px; block-size: 28px; }
.footer-brand .brand-wordmark { font-size: 1rem; }

.footer-brand p { margin-block-start: 12px; }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* /he/ only: says the legal links open English documents. Inset to line
   up with the link text (the links carry 10px inline padding). */
.footer-lang-note {
  margin: 0;
  padding-inline: 10px;
  font-size: .8125rem;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-block-size: 44px;
  padding-inline: 10px;
  border-radius: var(--radius-control);
  color: var(--color-text-muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--color-heading);
  background: var(--color-bg-soft);
}

.footer-note {
  flex-basis: 100%;
  font-size: .8125rem;
}

/* ---- Motion ---------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  .rise {
    animation: rise .8s var(--ease) both;
  }

  .rise-2 { animation-delay: .08s; }
  .rise-3 { animation-delay: .16s; }
  .rise-4 { animation-delay: .24s; }

  .preview-card { animation: rise .9s .2s var(--ease) both, float 7s 1.2s ease-in-out infinite; }

  /* Sections fade in as they scroll into view where the browser supports
     scroll-driven animations; elsewhere they are simply visible. */
  @supports (animation-timeline: view()) {
    .reveal {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 40%;
    }
  }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

/* ---- Responsive ------------------------------------------------------ */

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .preview { justify-self: start; }
  .steps, .benefits { grid-template-columns: 1fr; }
  .steps { max-inline-size: 36rem; }
  .step-top { margin-block-end: 20px; }
}

@media (max-width: 560px) {
  .nav { min-block-size: 60px; }
  .brand img { inline-size: 32px; block-size: 32px; }
  .brand-wordmark { font-size: 1.0625rem; }
  .lang-switch { padding-inline: 8px; }
  .nav .button-small { padding-inline: 14px; }
  .hero-actions .button-primary { flex: 1 1 100%; }
  .hero-actions .button-ghost { flex: 1 1 100%; }
  .preview { justify-self: stretch; inline-size: 100%; }
  .step { padding: 22px; }
  .why-panel { padding: 32px 22px; }
  .why .container { inline-size: min(100% - 24px, var(--max)); }
  .section { scroll-margin-block-start: 60px; }
  .footer-links { margin-inline: -10px; }
  .footer-lang-note { padding-inline: 0; }
}

/* Narrow phones: the dark band's padding leaves ~250px, so a 2rem
   heading would split each sentence; 1.75rem keeps one per line. */
@media (max-width: 400px) {
  .why-panel .section-title { font-size: 1.75rem; }
}

@media (max-width: 359px) {
  .brand-wordmark { display: none; }
  .hero-title { font-size: 2.5rem; }
}
