/* ============================================================================
   Lemon Studio — reset, base element styles, layout primitives, motion
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--surface-page);
  color: var(--text-body);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: var(--fw-body);
  line-height: var(--lh-body);
  /* NO direction here. The reading direction comes from dir="rtl" / dir="ltr"
     on <html>, which the language switch sets. An author `direction: rtl` on
     body outranks the direction inherited from that attribute, so the page
     stayed right-to-left with English text in it — every icon, bullet and
     separator sat on the wrong side. */
  overflow-x: hidden;
  text-wrap: pretty;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, picture, video, svg { display: block; max-width: 100%; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--text-strong);
  margin: 0;
  font-weight: var(--fw-display);
  line-height: var(--lh-heading);
  letter-spacing: var(--tracking-heading);
}
h1 { font-size: var(--fs-display-1); line-height: var(--lh-display); letter-spacing: var(--tracking-display); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); font-weight: var(--fw-strong); letter-spacing: 0; }

/* The browser's default bold is 700, which Assistant does not ship — it would
   be synthesised, and faux bold on a 300-weight page looks like a smudge.
   Anything that wants emphasis in body copy lands on 600 instead. Rules that
   set their own weight (the lemon .hl marks, prices) still win.
   `th` is here for the price tables, which are bold by browser default. */
b, strong, th { font-weight: var(--fw-medium); }

p  { margin: 0 0 var(--sp-4); }
p:last-child { margin-bottom: 0; }

a {
  color: var(--text-body);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}
a:hover { color: var(--accent-hover); }        /* everything hovers to a lighter yellow */

button { font: inherit; color: inherit; }

ul { margin: 0; padding: 0; list-style: none; }

/* The hidden attribute must win over any display we set on a component.
   Without this, `.field { display: grid }` quietly resurrects a hidden
   field — which is exactly the kind of bug you only see in a screenshot. */
[hidden] { display: none !important; }


::selection { background: var(--lemon-500); color: var(--ink-1000); }

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

/* Screen-reader only — used for the skip link and icon labels */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; inset-inline-start: 16px; top: -60px; z-index: 200;
  background: var(--lemon-500); color: var(--ink-1000);
  padding: 12px 20px; border-radius: var(--radius-sm); font-weight: var(--fw-medium);
  transition: top var(--dur-base) var(--ease-out);
}
.skip-link:focus { top: 16px; color: var(--ink-1000); }

/* ---------------------------------------------------------------- layout -- */

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
  width: 100%;
}
.container--narrow { max-width: var(--container-narrow); }

.section        { padding-block: var(--gap); }
.section--tight { padding-block: var(--gap-sm); }
.section--void  { background: var(--surface-void); }
.section--base  { background: var(--surface-base); }

/* ------------------------------------------------------------ typography -- */

/* Section eyebrow. Hebrew is barely tracked; Latin micro-labels are tracked out. */
.eyebrow {
  display: block;
  font-size: var(--fs-micro);
  font-weight: var(--fw-regular);
  letter-spacing: var(--tracking-he-label);
  color: var(--lemon-500);
  margin: 0 0 18px;
}
.eyebrow--latin { letter-spacing: var(--tracking-label); }

.lead {
  font-size: var(--fs-lead);
  color: var(--text-muted);
  max-width: 46ch;
}

.measure    { max-width: 22ch; }
.measure-lg { max-width: 19ch; }

/* One word of the hero gets a lemon underline. Never a highlight fill. */
/* The lemon underline under a marked phrase.
   A REAL text-decoration, not a background stripe, and that is the whole
   point: `text-decoration-skip-ink` makes the browser break the line wherever
   a descender crosses it. In Hebrew that means the tail of a final ן or ך
   cuts a clean notch through the rule instead of sitting on top of it — the
   letter and the mark share the space rather than colliding.
   The offset is tuned so the line lands INSIDE the descender's depth; move it
   much lower and the tail clears it and the notch disappears. */
.mark-underline {
  text-decoration-line: underline;
  text-decoration-color: var(--lemon-500);
  text-decoration-thickness: 3px;
  text-underline-offset: .1em;
  text-decoration-skip-ink: auto;
}

.rule { border: 0; border-top: 1px solid var(--rule-accent); margin: 0; }

/* --------------------------------------------------------------- motion --- */
/* Fades only. 18px rise + fade, fired once by IntersectionObserver.
   main.js force-completes everything after 2.5s so nothing can stay hidden.  */

[data-reveal] { opacity: 0; transform: translateY(18px); }
[data-reveal].is-in {
  opacity: 1;
  transform: none;
  transition: opacity var(--dur-reveal) var(--ease-reveal),
              transform var(--dur-reveal) var(--ease-reveal);
}
[data-reveal][data-reveal-delay="1"].is-in { transition-delay: .10s; }
[data-reveal][data-reveal-delay="2"].is-in { transition-delay: .20s; }
[data-reveal][data-reveal-delay="3"].is-in { transition-delay: .30s; }

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

/* Optional fractal-noise grain. Off by default (--grain-opacity: 0).
   Set it to .10 in tokens.css to switch it on. */
.grain {
  position: fixed; inset: 0; z-index: 80; pointer-events: none;
  opacity: var(--grain-opacity); mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>");
}

/* Locks scroll while the modal or lightbox is open */
body.is-locked { overflow: hidden; }
