/* ---------- tokens ---------- */
:root {
  --paper: #f7f7f5;
  --surface: #ecece8;
  --ink: #161616;
  --ink-soft: #6f6f6a;
  --rule: #e2e2dd;
  --accent: #7f93c4;        /* soft blue — used sparingly */
  --accent-ink: #4d5f93;    /* same hue, dark enough for text */
  --screen: #0e0e0f;

  --font: "IBM Plex Sans Hebrew", "IBM Plex Sans", system-ui, sans-serif;

  --gutter: clamp(16px, 4vw, 56px);
  --radius: 6px;
  --ease: cubic-bezier(.4, 0, .2, 1);
}
:root[lang="en"] { --font: "IBM Plex Sans", "IBM Plex Sans Hebrew", system-ui, sans-serif; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
section, footer { scroll-margin-top: 72px; }
body {
  margin: 0;
  background: var(--paper); color: var(--ink);
  font-family: var(--font); font-size: 17px; line-height: 1.6; font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: var(--accent); color: #fff; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a, button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.skip { position: absolute; inset-inline-start: var(--gutter); top: -60px; background: var(--ink); color: #fff; padding: 8px 14px; z-index: 100; }
.skip:focus { top: 12px; }

.section-title { margin: 0 0 24px; font-size: 15px; font-weight: 500; color: var(--ink-soft); }

/* ---------- bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 40;
  display: flex; justify-content: space-between; align-items: center;
  height: 64px; padding: 0 max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left));
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.bar.is-scrolled { border-color: var(--rule); }
.bar__name { font-weight: 600; font-size: 18px; text-decoration: none; }
.bar__nav { display: flex; align-items: center; gap: clamp(18px, 3vw, 36px); font-size: 15px; }
.bar__nav a { text-decoration: none; color: var(--ink-soft); transition: color .2s; }
.bar__nav a:hover { color: var(--ink); }
.bar__lang {
  font-family: "IBM Plex Sans", "IBM Plex Sans Hebrew", sans-serif;
  font-size: 13px; font-weight: 500; letter-spacing: .02em;
  padding: 5px 10px; border: 1px solid var(--rule); border-radius: 999px;
  transition: border-color .2s;
}
.bar__lang:hover { border-color: var(--ink); }

/* ---------- hero ---------- */
.hero { display: grid; gap: 14px; padding: clamp(48px, 9vw, 120px) var(--gutter) 0; }
.hero__title {
  margin: 0; font-weight: 500; text-wrap: balance;
  font-size: clamp(40px, 6vw, 88px); line-height: 1.02; letter-spacing: -0.02em;
}
.hero__lede { margin: 0; font-size: clamp(18px, 1.6vw, 22px); color: var(--ink-soft); max-width: 52ch; font-weight: 300; text-wrap: balance; }
.hero--home {
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  align-items: center; column-gap: clamp(16px, 4vw, 64px);
}
.hero__text { display: grid; gap: 14px; }

/* the waving stick figure: plain lines, endless wave from the elbow */
.waver { justify-self: center; width: clamp(150px, 19vw, 260px); height: auto; color: var(--ink); overflow: visible; }
.waver__flip { transform-box: view-box; transform-origin: 80px 110px; }
[dir="ltr"] .waver__flip { transform: scaleX(-1); }
.waver__shirt { fill: #e23b2e; stroke: currentColor; stroke-width: 4.5; stroke-linejoin: round; }
.waver__arm { transform-box: view-box; transform-origin: 40px 96px; }
.dance, .leg, .arm-r, .head { transform-box: view-box; }
.dance { transform-origin: 80px 206px; }      /* pivots on the feet */
.leg--l { transform-origin: 71px 151px; }
.leg--r { transform-origin: 89px 151px; }
.arm-r { transform-origin: 108px 119px; }
.head { transform-origin: 80px 94px; }

/* a silly ~7s routine: shuffle right, spin, shuffle left, hip wiggle — while waving */
@media (prefers-reduced-motion: no-preference) {
  .waver__arm { animation: wave 1.1s ease-in-out infinite; }
  .dance { animation: dance 7s ease-in-out infinite; }
  .leg--l { animation: kick-l 1.15s ease-in-out infinite; }
  .leg--r { animation: kick-r 1.15s ease-in-out infinite .575s; }
  .arm-r { animation: pump 2.3s ease-in-out infinite; }
  .head { animation: bob 1.15s ease-in-out infinite; }
}
@keyframes wave {
  0%, 100% { transform: rotate(-16deg); }
  50% { transform: rotate(22deg); }
}
@keyframes dance {
  0%   { transform: translate(0, 0) rotate(0) scaleX(1); }
  8%   { transform: translate(6px, -7px) rotate(5deg) scaleX(1); }
  16%  { transform: translate(12px, 0) rotate(-3deg) scaleX(1); }
  24%  { transform: translate(18px, -7px) rotate(4deg) scaleX(1); }
  32%  { transform: translate(14px, 0) rotate(0) scaleX(1); }
  38%  { transform: translate(10px, -10px) rotate(0) scaleX(-1); }
  46%  { transform: translate(4px, 0) rotate(0) scaleX(1); }
  54%  { transform: translate(-4px, -7px) rotate(-5deg) scaleX(1); }
  62%  { transform: translate(-12px, 0) rotate(3deg) scaleX(1); }
  70%  { transform: translate(-18px, -7px) rotate(-4deg) scaleX(1); }
  78%  { transform: translate(-12px, 0) rotate(8deg) scaleX(1); }
  86%  { transform: translate(-6px, 0) rotate(-8deg) scaleX(1); }
  93%  { transform: translate(-2px, 0) rotate(6deg) scaleX(1); }
  100% { transform: translate(0, 0) rotate(0) scaleX(1); }
}
@keyframes kick-l {
  0%, 50%, 100% { transform: rotate(0); }
  25% { transform: rotate(24deg); }
}
@keyframes kick-r {
  0%, 50%, 100% { transform: rotate(0); }
  25% { transform: rotate(-24deg); }
}
@keyframes pump {
  0%, 100% { transform: rotate(0); }
  50% { transform: rotate(-75deg); }
}
@keyframes bob {
  0%, 100% { transform: rotate(-7deg); }
  50% { transform: rotate(7deg); }
}

.very { font-size: 1.3em; font-weight: 600; color: var(--ink); }
.film {
  margin: clamp(64px, 8vw, 110px) auto 0; padding: 0 var(--gutter);
  max-width: 60ch; text-align: center; font-size: clamp(17px, 1.4vw, 20px); color: var(--ink-soft); text-wrap: balance;
}
.film a { color: var(--accent-ink); font-weight: 500; text-underline-offset: 3px; }
.film a:hover { color: var(--ink); }

.intro {
  display: grid; gap: 14px; justify-items: start;
  margin-top: clamp(20px, 3vw, 36px); padding-top: clamp(20px, 3vw, 32px);
  border-top: 1px solid var(--rule); max-width: 640px;
}
.intro__text { margin: 0; font-size: clamp(17px, 1.3vw, 19px); color: var(--ink-soft); text-wrap: pretty; }
.intro__text > :first-child { color: var(--ink); font-weight: 500; }
.more {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 500; text-decoration: none; color: var(--accent-ink);
}
.more__arrow { transition: transform .3s var(--ease); }
.more:hover .more__arrow { transform: translateX(-4px); }
[dir="ltr"] .more__arrow { display: inline-block; transform: scaleX(-1); }
[dir="ltr"] .more:hover .more__arrow { transform: scaleX(-1) translateX(-4px); }
.more--back { margin-top: 32px; }
.more--back:hover .more__arrow { transform: translateX(4px); }
[dir="ltr"] .more--back:hover .more__arrow { transform: scaleX(-1) translateX(4px); }
.bar__nav a[aria-current="page"] { color: var(--ink); }
.page-about .about { padding-top: clamp(56px, 7vw, 96px); }
.about__title { max-width: 18ch; }
.about__title .very { font-size: 1.15em; }
.about.about--cv { display: block; }
.about--cv .cv { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(32px, 6vw, 96px); align-items: start; }
@media (max-width: 760px) { .about--cv .cv { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: no-preference) {
  .hero > * { opacity: 0; transform: translateY(12px); animation: in .8s var(--ease) forwards; }
  .hero > .hero__lede { animation-delay: .08s; }
  .work { opacity: 0; transform: translateY(16px); animation: in 1s var(--ease) .18s forwards; }
}
@keyframes in { to { opacity: 1; transform: none; } }

/* ---------- work ---------- */
.work { padding: clamp(56px, 7vw, 96px) var(--gutter) 0; }
.work__head {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline;
  gap: 16px 32px; margin-bottom: 28px;
}
.work__head h2 { margin: 0; font-size: clamp(28px, 3vw, 40px); font-weight: 500; letter-spacing: -0.01em; }

.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filter {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 7px 14px; border-radius: 999px; font-size: 15px;
  color: var(--ink-soft); border: 1px solid var(--rule);
  transition: color .2s, border-color .2s, background .2s;
}
.filter:hover { color: var(--ink); border-color: #c9c9c3; }
.filter[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.filter__n { font-size: 12px; opacity: .6; font-variant-numeric: tabular-nums; }

.group[hidden] { display: none; }
.group + .group { margin-top: clamp(64px, 8vw, 110px); }
.group__title {
  display: flex; align-items: baseline; gap: 10px;
  margin: 0 0 20px; padding-top: 16px; border-top: 1px solid var(--rule);
  font-size: 20px; font-weight: 500;
}

.grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(28px, 3vw, 44px) clamp(14px, 1.6vw, 24px);
}
.grid + .grid { margin-top: clamp(28px, 3vw, 44px); }
.grid--v { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid--sq { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--series { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.series { margin-bottom: clamp(40px, 5vw, 64px); }
.series__title {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px;
  margin: 0 0 16px; font-size: 18px; font-weight: 500;
}
.series__about { font-size: 14px; font-weight: 400; color: var(--ink-soft); }
.card__btn { display: block; width: 100%; text-align: start; }
.card__media {
  position: relative; display: block; aspect-ratio: 16 / 9;
  border-radius: var(--radius); overflow: hidden; background: var(--surface);
}
.card--v .card__media { aspect-ratio: 9 / 16; }
.card--sq .card__media { aspect-ratio: 1; }
.card--v .card__text { flex-direction: column; gap: 0; }
.card--v .card__title { font-size: 15px; }
.card__poster, .card__media video {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .7s var(--ease), opacity .3s;
}
.card__media video { opacity: 0; }
.card__media video.is-playing { opacity: 1; }
.card__dur {
  position: absolute; inset-inline-end: 10px; bottom: 10px;
  padding: 2px 8px; border-radius: 4px;
  background: rgba(14,14,15,.62); color: #fff;
  font-size: 12px; font-variant-numeric: tabular-nums;
  opacity: 0; transition: opacity .3s;
}
.card__text { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-top: 12px; }
.card__title { font-size: 16px; font-weight: 500; line-height: 1.35; transition: color .2s; }
.card__role { display: block; font-size: 14px; color: var(--ink-soft); font-weight: 400; margin-top: 2px; }
.card__year { font-size: 14px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

.card__btn:hover .card__media > :is(img, video),
.card__btn:focus-visible .card__media > :is(img, video) { transform: scale(1.03); }
.card__btn:hover .card__dur,
.card__btn:focus-visible .card__dur { opacity: 1; }
.card__btn:hover .card__title { color: var(--accent-ink); }

/* ---------- about ---------- */
.about {
  display: grid; grid-template-columns: 7fr 5fr; gap: clamp(40px, 7vw, 120px);
  padding: clamp(100px, 12vw, 170px) var(--gutter) 0; align-items: start;
}
.about__lede { margin: 0 0 24px; font-size: clamp(24px, 2.4vw, 34px); line-height: 1.3; font-weight: 400; letter-spacing: -0.01em; max-width: 30ch; text-wrap: balance; }
.about__text > p:not(.about__lede) { margin: 0 0 16px; color: var(--ink-soft); max-width: 60ch; text-wrap: pretty; }

.cv { display: grid; gap: 48px; padding-top: 8px; }
.cv__title { margin: 0 0 8px; font-size: 15px; font-weight: 500; color: var(--ink-soft); }
.cv__list { list-style: none; margin: 0; padding: 0; }
.cv__list li { display: grid; gap: 4px; padding: 16px 0; border-top: 1px solid var(--rule); }
.cv__list li:last-child { border-bottom: 1px solid var(--rule); }
.cv__role { font-size: 17px; font-weight: 500; }
.cv__desc { font-size: 15px; color: var(--ink-soft); text-wrap: pretty; }

/* ---------- contact ---------- */
.contact {
  margin-top: clamp(100px, 12vw, 170px);
  padding: clamp(56px, 7vw, 96px) var(--gutter) 28px;
  border-top: 1px solid var(--rule);
}
.contact__lead { margin: 0 0 6px; font-size: clamp(18px, 1.6vw, 22px); font-weight: 300; color: var(--ink-soft); }
.contact__mail {
  display: inline-block; text-decoration: none;
  font-family: "IBM Plex Sans", sans-serif; font-weight: 500;
  font-size: clamp(28px, 6.4vw, 96px); letter-spacing: -0.03em; line-height: 1.1;
  background: linear-gradient(var(--accent), var(--accent)) no-repeat 0 100% / 0 2px;
  transition: background-size .5s var(--ease), color .3s;
}
.contact__mail:hover { background-size: 100% 2px; color: var(--accent-ink); }
.contact__social { display: flex; gap: 12px; list-style: none; margin: 28px 0 0; padding: 0; }
.social {
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%;
  border: 1px solid var(--rule); color: var(--ink);
  transition: background-color .2s, border-color .2s, color .2s;
}
.social svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.social:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.contact__meta {
  display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: clamp(56px, 7vw, 96px);
  font-size: 14px; color: var(--ink-soft);
}
.contact__meta a { text-decoration: none; transition: color .2s; }
.contact__meta a:hover { color: var(--ink); }
.contact__copy { margin-inline-start: auto; }

/* ---------- player ---------- */
.player {
  width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0;
  padding: 20px var(--gutter) var(--gutter); border: 0;
  background: var(--screen); color: #fff;
  display: none; grid-template-rows: auto minmax(0, 1fr) auto auto; gap: 16px;
  overscroll-behavior: contain;
}
.player[open] { display: grid; }
.player::backdrop { background: var(--screen); }
.player__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
.player__title { margin: 0; font-size: 18px; font-weight: 500; }
.player__meta { margin: 2px 0 0; font-size: 14px; color: rgba(255,255,255,.55); }
.player__close {
  font-size: 14px; padding: 6px 14px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.25); transition: border-color .2s;
}
.player__close:hover { border-color: #fff; }
.player__frame { position: relative; min-height: 0; overflow: hidden; }
.player__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.player__why { max-width: 70ch; }
.player__why[hidden] { display: none; }
.player__why-title { margin: 0 0 4px; font-size: 13px; font-weight: 500; color: rgba(255,255,255,.55); }
.player__why-text { margin: 0; font-size: 15px; line-height: 1.6; color: rgba(255,255,255,.88); text-wrap: pretty; }
.player__nav { display: flex; justify-content: space-between; align-items: center; gap: 16px; font-size: 14px; }
.player__step {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px; color: rgba(255,255,255,.75);
  transition: color .2s, background-color .2s;
}
.player__step:hover { color: #fff; background: rgba(255,255,255,.08); }
.player__count { color: rgba(255,255,255,.45); font-variant-numeric: tabular-nums; }
[dir="ltr"] .player__arrow { display: inline-block; transform: scaleX(-1); }
.player :focus-visible { outline-color: #fff; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--v { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid--sq { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid--series { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .hero--home { grid-template-columns: minmax(0, 1fr) auto; }
  .waver { width: 112px; }
  .grid { grid-template-columns: 1fr; }
  .grid--v, .grid--sq, .grid--series { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 12px; }
  .bar__nav { gap: 14px; font-size: 14px; }
  .about { grid-template-columns: 1fr; }
  .cv { padding-top: 8px; }
  .work__head { display: grid; grid-template-columns: minmax(0, 1fr); }
  .filters { min-width: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); }
  .filter { flex: none; }
  .contact__copy { margin-inline-start: 0; width: 100%; }
  .card__dur { opacity: 1; }
}

/* ---------- 404 ---------- */
.notfound { min-height: 70vh; align-content: center; }
.notfound > * { justify-self: start; }
.notfound__code { margin: 0; font-size: 15px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.notfound__back { color: var(--accent-ink); text-decoration: none; font-weight: 500; }
.notfound__back:hover { text-decoration: underline; }

/* ---------- scroll reveal ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] {
    opacity: 0; transform: translateY(24px);
    transition: opacity .8s var(--ease), transform .8s var(--ease);
    transition-delay: calc(var(--i, 0) * 70ms);
  }
  .js [data-reveal].is-in { opacity: 1; transform: none; }
}
