/* SENTENCE. One page: the opening, what we do, who we work with, and a phone number.
   Paper, ink and one red pen. Motion only where it means something: the logo writes itself once per loop,
   sections arrive once, buttons answer the press. Only opacity, transform and colour are animated. */

:root {
  color-scheme: light;
  --paper: #F6F6F3;
  --ink: #141414;
  --graphite: #3A3A37;
  --gray: #6B6B66;
  --rule: #DEDDD7;
  --red: #C8321F;
  --red-deep: #9E2416;
  --tint: #EFD7D1;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  /* Latin text speaks in the logo's typeface, IBM Plex Mono Medium. Plex Mono has no Hebrew letters; Hebrew is set in
     IBM Plex Sans Hebrew Medium (the founder's pick, "Plex עברי"), and leads on Hebrew pages so spaces and stops fit
     Hebrew words. A monospaced Hebrew was tried and rejected: narrow letters float apart in fixed cells */
  --heb: 'IBM Plex Sans Hebrew';
  --text: 'IBM Plex Mono', var(--heb), ui-monospace, Menlo, monospace;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --gutter: clamp(16px, 5vw, 48px);
  --header: clamp(64px, 7vw, 84px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html:lang(he) body, [lang="he"]:not(html) { font-family: var(--heb), var(--mono); }
html:lang(he) [lang="en"], html:lang(he) .phone, html:lang(he) .lg { font-family: var(--mono); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
/* mono at display sizes: tighten tracking and word gaps, as large type wants */
[dir="ltr"] .tagline, [dir="ltr"] .three, [dir="ltr"] h2, [dir="ltr"] .who-lines, [dir="ltr"] .disc h3, [dir="ltr"] .btn { letter-spacing: -0.02em; word-spacing: -0.22em; }
[dir="ltr"] .disc .lines, [dir="ltr"] .call .note, [dir="ltr"] .site-footer { letter-spacing: -0.01em; word-spacing: -0.14em; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-weight: 500;
  font-size: 1.125rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: var(--tint); color: var(--ink); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 2px; }
.wrap { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: var(--gutter); }
html { scroll-padding-top: calc(var(--header) + 8px); }
/* long display lines break evenly; body text avoids one-word tails */
h2, .tagline, .three li, .who-lines li { text-wrap: balance; }
p, li { text-wrap: pretty; }

.skip { position: absolute; inset-inline-start: 12px; top: 0; z-index: 30; max-width: calc(100vw - 24px); background: var(--ink); color: var(--paper); padding: 8px 14px; text-decoration: none; transform: translateY(-110%); transition: transform 160ms var(--ease-out); }
.skip:focus { transform: translateY(12px); }

/* ---------- the logo ---------- */
.lg { direction: ltr; unicode-bidi: isolate; white-space: nowrap; line-height: 1; display: inline-block; position: relative; font-family: var(--mono); font-weight: 500; color: var(--ink); }
.lg .pm { display: inline-block; font-size: .56em; vertical-align: .6em; margin-right: .2em; color: var(--red); }
.lg .wdw { position: relative; display: inline-block; }
/* the pilcrow outside the logo is the logo's pilcrow: same face, colour, proportion, rise and gap. It opens something; it is never decoration */
.pil { font-family: var(--mono); font-weight: 500; font-style: normal; color: var(--red); font-size: .56em; vertical-align: .6em; line-height: 0; letter-spacing: 0; word-spacing: 0; margin-inline-end: .2em; display: inline-block; }
/* Hebrew letters (Plex Sans Hebrew Medium) stand 62/100 tall against Plex Mono's 69.8/100 capitals; scale the mark by
   the same ratio (.56 x 60.8/69.8 = .49) so it keeps the logo's exact relation to the letters it opens; the gap measured to match */
html[lang="he"] .pil { font-size: .49em; margin-inline-end: .16em; }
.lg .wd { display: inline-block; letter-spacing: .08em; }
.lg .tc { position: absolute; opacity: 0; background: var(--red); }

/* ---------- header: a translucent layer the page scrolls under ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  height: var(--header);
  background: rgba(246, 246, 243, 0.72);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  backdrop-filter: blur(16px) saturate(180%);
}
/* scroll edge: a soft shade only once content is underneath, never a hard line at rest */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .site-header { background: var(--paper); } }
@media (prefers-reduced-transparency: reduce) { .site-header { background: var(--paper); -webkit-backdrop-filter: none; backdrop-filter: none; } }
@media (prefers-contrast: more) { .site-header { background: var(--paper); } }
.site-header .wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.hdr-end { display: flex; align-items: center; gap: clamp(10px, 2vw, 24px); }
#menuSlot:empty, #langSlot:empty { display: none; }
.home { text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; -webkit-tap-highlight-color: transparent; }
.home .lg { transition: opacity 160ms ease; }
.home:active .lg { opacity: .7; }
.home .lg { font-size: clamp(17px, 2.1vw, 23px); }

@media (max-width: 370px) { .home .lg { font-size: 15px; } }

/* ---------- the opening ---------- */
.hero { position: relative; min-height: calc(100vh - var(--header)); min-height: calc(100svh - var(--header)); display: grid; place-items: center; text-align: center; padding-block: clamp(48px, 10vh, 120px); }
.hero .wrap { display: grid; justify-items: center; gap: clamp(20px, 3.2vh, 32px); }
.hero-logo { margin: 0; font-weight: inherit; }
.hero-logo .lg { font-size: clamp(48px, 11vw, 140px); }
.hero-logo.paused .lg * { animation-play-state: paused !important; }
.hero-logo.stopped .lg * { animation: none !important; }
/* WCAG 2.2.2: a looping animation needs a way to stop it. Quiet, out of the reading line. */
.motion-toggle {
  position: absolute; bottom: 12px; inset-inline-start: var(--gutter);
  background: none; border: 0; padding: 0 2px; min-height: 44px; cursor: pointer;
  font-size: 0.9375rem; color: var(--gray); text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 4px;
  transition: color 160ms ease, text-decoration-color 160ms ease;
  -webkit-tap-highlight-color: transparent;
}
.motion-toggle:active { color: var(--ink); }
@media (hover: hover) and (pointer: fine) { .motion-toggle:hover { color: var(--ink); text-decoration-color: var(--rule); } }
@media (max-width: 760px) { .motion-toggle { top: 8px; bottom: auto; } }
@media (prefers-reduced-motion: reduce) { .motion-toggle { display: none; } }
.tagline { font-size: clamp(1.1875rem, 1.8vw, 1.5rem); font-weight: 500; letter-spacing: 0; }
.three { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: clamp(1.25rem, 2.2vw, 1.6875rem); line-height: 1.5; color: var(--graphite); }
.three a { text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 6px; text-decoration-thickness: 1.5px; transition: text-decoration-color 200ms ease, color 200ms ease; -webkit-tap-highlight-color: transparent; }
.three a:active { color: var(--ink); text-decoration-color: var(--red); }
@media (pointer: coarse) { .three { gap: 0; } .three a { display: inline-block; padding-block: 9px; } }
@media (hover: hover) and (pointer: fine) { .three a:hover { color: var(--ink); text-decoration-color: var(--red); } }
.btn {
  display: inline-block; text-align: center; text-wrap: balance;
  min-height: 48px; padding: 12px 24px;
  border: 1px solid var(--ink); background: transparent; color: var(--ink);
  font-size: 1.125rem; font-weight: 500; text-decoration: none; cursor: pointer;
  transition: background-color 200ms ease, color 200ms ease, transform 160ms var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) { .btn:hover { background: var(--ink); color: var(--paper); } }

@media (max-width: 380px) { .btn { padding-inline: 16px; font-size: 1rem; } }
.hero .btn { margin-top: 8px; }

/* ---------- what we do ---------- */
.what { padding-block: clamp(72px, 12vw, 160px); }
.sec-head { display: grid; gap: 14px; margin-bottom: clamp(36px, 6vw, 72px); }
.sec-head h2 { max-width: 26ch; }
/* the pilcrow opens each section: a new paragraph, nothing more */
.sec-head h2 { font-size: clamp(2.125rem, 4.6vw, 3.5rem); line-height: 1.1; font-weight: 500; }
[dir="ltr"] .sec-head h2 { letter-spacing: -0.02em; }
#disciplines { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 4vw, 56px); }
@media (max-width: 860px) { #disciplines { grid-template-columns: minmax(0, 1fr); gap: 0; } }
.disc { display: grid; align-content: start; gap: 14px; }
@media (max-width: 860px) { #disciplines { gap: 40px; } }
.disc h3 { font-size: clamp(1.375rem, 2.2vw, 1.75rem); font-weight: 500; line-height: 1.2; }
.disc .lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5em; color: var(--graphite); font-size: clamp(1.0625rem, 1.4vw, 1.25rem); line-height: 1.5; }
.closing { margin-top: clamp(40px, 6vw, 72px); display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }

/* ---------- who: four lines, no names ---------- */
.who { padding-block: clamp(72px, 11vw, 150px); }
.who .sec-head { margin-bottom: clamp(28px, 4vw, 48px); }
.who-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: clamp(1.375rem, 2.7vw, 2.125rem); line-height: 1.3; font-weight: 500; max-width: 40ch; }
[dir="ltr"] .who-lines { letter-spacing: -0.01em; }
.who-lines .aside { color: var(--gray); }

/* ---------- call: one line, one number ---------- */
.call { padding-block: clamp(96px, 14vw, 180px); }
.call .wrap { display: grid; gap: clamp(18px, 2.6vw, 28px); justify-items: start; }
.call h2 { font-size: clamp(2rem, 5.6vw, 4.5rem); line-height: 1.08; font-weight: 500; max-width: 18ch; }
[dir="ltr"] .call h2 { letter-spacing: -0.025em; }
.phone {
  display: inline-flex; align-items: baseline; gap: .45em; min-height: 48px;
  font-family: var(--mono); font-weight: 500; font-size: clamp(1.625rem, 4.2vw, 3.125rem); letter-spacing: .04em;
  color: var(--ink); text-decoration: underline; text-decoration-color: transparent; text-underline-offset: .22em; text-decoration-thickness: 2px;
  transition: text-decoration-color 200ms ease, transform 160ms var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
#phoneText { white-space: nowrap; }
.phone:active { transform: scale(0.98); }
@media (hover: hover) and (pointer: fine) { .phone:hover { text-decoration-color: var(--red); } }
.call .note { color: var(--gray); }

/* ---------- footer ---------- */
.site-footer { padding-block: 32px; font-size: 1rem; color: var(--gray); }
.site-footer .wrap { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.site-footer .sign { color: var(--ink); }


/* ---------- arrival: once, short, staggered. Only when JS is on, so nothing hides without it ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(10px); transition: opacity 520ms var(--ease-out), transform 520ms var(--ease-out); transition-delay: calc(var(--i, 0) * 60ms); }
.js [data-reveal].in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { transform: none; transition: opacity 200ms ease; transition-delay: 0ms; }
  .btn, .phone { transition-duration: 0ms; }
  .btn:active, .phone:active { transform: none; }
  .skip { transition: none; }
}

/* language switch: a quick cross-fade so the direction flip is not a jolt */
.lang-settling .site-header .wrap { pointer-events: none; }
.lang-wait main, .lang-wait .site-header .wrap, .lang-wait .site-footer { opacity: 0; }
main, .site-footer, .site-header .wrap { transition: opacity 140ms ease; }
.switching main, .switching .site-footer, .switching .site-header .wrap { opacity: 0; }

/* print the whole page, with the finished logo */
@media print { .js [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; } .hero-logo .lg * { animation: none !important; } .motion-toggle { display: none; } .site-header { position: static; } }

/* ---------- headings type themselves once: red draft, then ink ---------- */
.typed .ch { position: relative; }
.js .typed:not(.done) .ch { opacity: 0; }
.js .typed .ch.on { opacity: 1; color: var(--red); transition: color 260ms ease; }
.js .typed.settled .ch.on { color: inherit; }
.typed .ch.cur::after { content: ""; position: absolute; inset-inline-start: 100%; top: .25em; width: .06em; height: .85em; background: var(--red); }
html[lang="he"] .typed .ch.cur::after { top: .3em; height: .8em; }
/* once typed, the caret stays at the end of the heading and keeps blinking; the stop control and reduced motion hold it still */
.typed .ch.cur.forever::after { animation: caret-blink 1060ms steps(1, end) var(--blink-delay, 0ms) infinite; }
html.motion-stopped .typed .ch.cur.forever::after { animation: none; }
@media (prefers-reduced-motion: reduce) { .typed .ch.cur.forever::after { animation: none; } }
@keyframes caret-blink { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 0; } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }


@media (max-width: 340px) { .site-footer [lang="en"] { font-size: .875rem; } }

/* footer: the accessibility statement sits beside the copyright */
.foot-end { display: inline-flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; }
.a11y-link { color: var(--graphite); text-underline-offset: 5px; text-decoration-color: var(--rule); min-height: 44px; display: inline-flex; align-items: center; -webkit-tap-highlight-color: transparent; }
@media (hover: hover) and (pointer: fine) { .a11y-link:hover { color: var(--ink); text-decoration-color: var(--red); } }
