/* ==========================================================================
   Busoft — base: reset, typography, layout primitives, motion primitives
   Logical properties only. RTL works by flipping dir="rtl".
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-block-start: calc(var(--header-h) + 1.5rem);
}

body {
  margin: 0;
  background: var(--surface-page);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  line-height: var(--lh-body);
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

html[lang="he"] body,
body[dir="rtl"],
[dir="rtl"] { font-family: var(--font-he); }

h1, h2, h3, h4, h5, p, figure, blockquote, dl, dd, pre { margin: 0; }
ul, ol { margin: 0; padding: 0; }
ul[class], ol[class] { list-style: none; }
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }

button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }

a { color: var(--accent-ink); text-decoration: none; }
a:hover { color: var(--accent-strong); text-decoration: underline; text-underline-offset: .18em; }
.is-dark a { color: var(--accent-soft); }
.is-dark a:hover { color: #ffffff; }

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

::selection { background: var(--accent-tint-2); color: var(--accent-ink); }

hr { border: 0; block-size: 1px; background: var(--border); margin-block: var(--space-7); }

/* --------------------------------------------------------------------------
   Type
   -------------------------------------------------------------------------- */

h1, .h1, h2, .h2, h3, .h3, h4, .h4 {
  font-weight: 800;
  letter-spacing: var(--tr-head);
  line-height: var(--lh-head);
  color: var(--text);
  text-wrap: balance;
}

h1, .h1 { font-size: var(--fs-4xl); font-weight: 900; line-height: var(--lh-tight); letter-spacing: var(--tr-tight); }
h2, .h2 { font-size: var(--fs-3xl); line-height: var(--lh-snug); }
h3, .h3 { font-size: var(--fs-xl); }
h4, .h4 { font-size: var(--fs-lg); font-weight: 700; }

[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] .h1, [dir="rtl"] .h2 {
  letter-spacing: 0; /* Hebrew must never be tracked-in */
  line-height: 1.18;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: var(--tr-eyebrow);
  text-transform: uppercase;
  color: var(--accent-ink);
}
[dir="rtl"] .eyebrow { letter-spacing: .06em; }
.eyebrow::before {
  content: "";
  inline-size: 22px;
  block-size: 2px;
  border-radius: 2px;
  background: var(--accent);
  flex: none;
}

.lead {
  font-size: var(--fs-lg);
  color: var(--text-soft);
  max-inline-size: var(--measure);
  text-wrap: pretty;
}

.muted { color: var(--text-soft); }
.small { font-size: var(--fs-sm); }
.mono { font-family: var(--font-mono); font-size: .92em; }

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

/* --------------------------------------------------------------------------
   Layout primitives
   -------------------------------------------------------------------------- */

.container {
  inline-size: min(100% - (var(--gutter) * 2), 1200px);
  margin-inline: auto;
}
.container--narrow { inline-size: min(100% - (var(--gutter) * 2), 880px); }
.container--wide { inline-size: min(100% - (var(--gutter) * 2), 1360px); }

.section { padding-block: var(--section-y); position: relative; }
.section--tight { padding-block: clamp(2.25rem, 4vw, 3.5rem); }
.section--flush-top { padding-block-start: 0; }
.section--sunken { background: var(--surface-sunken); }
.section--white { background: var(--surface); }
.section--dark { background: var(--surface-dark); color: var(--text-on-dark); }

.section__head {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-inline-size: 62ch;
  margin-block-end: var(--space-7);
}
.section__head--center { margin-inline: auto; text-align: center; align-items: center; }
.section__head--split {
  max-inline-size: none;
  flex-direction: row;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-5);
  flex-wrap: wrap;
}
.section__head--split > .section__head-text {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-inline-size: 60ch;
}

.stack { display: flex; flex-direction: column; gap: var(--space-4); }
.stack--lg { gap: var(--space-6); }
.stack--sm { gap: var(--space-2); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.row--between { justify-content: space-between; }

.grid { display: grid; gap: var(--space-5); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 232px), 1fr)); }

.divider { block-size: 1px; background: var(--border); }
.sr-only {
  position: absolute; inline-size: 1px; block-size: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute;
  inset-block-start: -100%;
  inset-inline-start: var(--space-4);
  z-index: var(--z-top);
  background: var(--surface-dark);
  color: #fff;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--r-sm);
}
.skip-link:focus-visible { inset-block-start: var(--space-3); }

/* Decorative gradient blobs — pure CSS, no images */
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(64px);
  opacity: .55;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(circle at 30% 30%, var(--grad-a), transparent 62%),
              radial-gradient(circle at 70% 70%, var(--grad-b), transparent 60%);
}
.blob--a { inline-size: 46vw; block-size: 46vw; inset-block-start: -14vw; inset-inline-end: -12vw; }
.blob--b { inline-size: 34vw; block-size: 34vw; inset-block-end: -16vw; inset-inline-start: -10vw; opacity: .38; }

.mesh {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(60% 80% at 78% 8%, var(--accent-tint-2), transparent 70%),
    radial-gradient(50% 60% at 4% 96%, var(--accent-tint), transparent 72%);
}

.z-1 { position: relative; z-index: 1; }

/* --------------------------------------------------------------------------
   Scroll reveal (JS adds .is-in; CSS does the animating)
   -------------------------------------------------------------------------- */

[data-reveal] {
  opacity: 0;
  transform: translate3d(0, var(--reveal-shift), 0);
  transition:
    opacity var(--dur-4) var(--ease-out),
    transform var(--dur-4) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
[data-reveal="start"] { transform: translate3d(calc(var(--reveal-shift) * -1.4), 0, 0); }
[data-reveal="end"]   { transform: translate3d(calc(var(--reveal-shift) * 1.4), 0, 0); }
[data-reveal="scale"] { transform: scale(.965); }
[data-reveal].is-in { opacity: 1; transform: none; }

/* RTL: mirror the horizontal slide-ins */
[dir="rtl"] [data-reveal="start"] { transform: translate3d(calc(var(--reveal-shift) * 1.4), 0, 0); }
[dir="rtl"] [data-reveal="end"]   { transform: translate3d(calc(var(--reveal-shift) * -1.4), 0, 0); }

/* No-JS safety: content must never stay invisible */
.no-js [data-reveal] { opacity: 1; transform: none; }

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

@keyframes dash-flow { to { stroke-dashoffset: -240; } }
@keyframes node-pulse {
  0%, 100% { opacity: .35; transform: scale(1); }
  50%      { opacity: .9;  transform: scale(1.28); }
}
@keyframes draw-in { to { stroke-dashoffset: 0; } }
@keyframes float-y {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50%      { transform: translate3d(0, -10px, 0); }
}
@keyframes fade-up-in {
  from { opacity: 0; transform: translate3d(0, 14px, 0); }
  to   { opacity: 1; transform: none; }
}
@keyframes shimmer { to { background-position: 200% 0; } }

/* Print: flatten motion + dark bands */
@media print {
  .site-header, .drawer, .share, .burger { display: none !important; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  .section--dark, .hero--dark, .cta-band { background: #fff !important; color: #000 !important; }
}
